You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/10/16 21:37:51 UTC

[GitHub] aharui closed pull request #317: Service classes emulated

aharui closed pull request #317: Service classes emulated
URL: https://github.com/apache/royale-asjs/pull/317
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 9e8b4a318..ba2148e59 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -173,7 +173,13 @@ internal class MXRoyaleClasses
 	import mx.managers.ToolTipManager; ToolTipManager;
 	import mx.managers.IToolTipManager2; IToolTipManager2;
 	import mx.utils.PopUpUtil; PopUpUtil;
-	
+	import mx.rpc.http.HTTPMultiService; HTTPMultiService;
+	import mx.rpc.http.HTTPServiceWrapper; HTTPServiceWrapper;
+	import mx.messaging.messages.HTTPRequestMessage; HTTPRequestMessage;
+	import mx.messaging.channels.DirectHTTPChannel; DirectHTTPChannel;
+	import mx.messaging.errors.MessageSerializationError; MessageSerializationError;
+	import mx.rpc.http.SerializationFilter; SerializationFilter;
+	import mx.rpc.http.AbstractOperation; AbstractOperation;
 
 	COMPILE::JS
     {
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/DirectHTTPChannel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/DirectHTTPChannel.as
new file mode 100644
index 000000000..96ff76836
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/DirectHTTPChannel.as
@@ -0,0 +1,543 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.messaging.channels
+{
+	COMPILE::SWF
+	{
+		import flash.events.Event;
+		import flash.events.IOErrorEvent;
+		import flash.events.SecurityErrorEvent;
+		import flash.events.ErrorEvent;
+		import flash.events.TimerEvent;
+		import flash.net.URLLoader;
+		import flash.net.URLRequest;
+		import flash.net.URLRequestHeader;
+		import flash.net.URLVariables;
+		import flash.events.HTTPStatusEvent;
+	}
+	
+	COMPILE::JS
+	{
+		import org.apache.royale.events.Event;
+		import mx.events.IOErrorEvent;
+		import mx.events.ErrorEvent;
+		import mx.events.SecurityErrorEvent;
+		import org.apache.royale.events.EventDispatcher;
+		import org.apache.royale.net.URLLoader;
+		import org.apache.royale.net.URLRequest;
+		import org.apache.royale.net.URLRequestHeader;
+		import mx.events.HTTPStatusEvent;	
+	}
+	
+	import mx.core.mx_internal;
+	import mx.messaging.Channel;
+	import mx.messaging.MessageAgent;
+	import mx.messaging.MessageResponder;
+	import mx.messaging.errors.ChannelError;
+	import mx.messaging.errors.InvalidChannelError;
+	import mx.messaging.errors.MessageSerializationError;
+	import mx.messaging.messages.AcknowledgeMessage;
+	import mx.messaging.messages.ErrorMessage;
+	import mx.messaging.messages.HTTPRequestMessage;
+	import mx.messaging.messages.IMessage;
+	import mx.messaging.config.LoaderConfig;
+	import mx.netmon.NetworkMonitor;
+	import mx.resources.IResourceManager;
+	import mx.resources.ResourceManager;
+	
+	use namespace mx_internal;
+	
+	[ResourceBundle("messaging")]
+	
+	[ExcludeClass]
+	
+	/**
+	 *  @private
+	 *  The DirectHTTPChannel class is used to turn an HTTPRequestMessage object into an
+	 *  HTTP request.
+	 *  This Channel does not connect to a Flex endpoint.
+	 */
+	public class DirectHTTPChannel extends Channel
+	{
+		/**
+		 *  Constructs an instance of a DirectHTTPChannel.
+		 *  The parameters are not used.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		public function DirectHTTPChannel(id:String, uri:String="")
+		{
+			super(id, uri);
+			if (uri.length > 0)
+			{
+				var message:String = resourceManager.getString(
+					"messaging", "noURIAllowed");
+				throw new InvalidChannelError(message);
+			}
+			clientId = ("DirectHTTPChannel" + clientCounter++);
+		}
+		
+		/**
+		 * @private
+		 * Used by DirectHTTPMessageResponder to specify a dummy clientId for AcknowledgeMessages.
+		 * Each instance of this channel gets a new clientId.
+		 */ 
+		mx_internal var clientId:String;
+		
+		/**
+		 *  @private
+		 */
+		private var resourceManager:IResourceManager =
+			ResourceManager.getInstance();
+		
+		/**
+		 *  Indicates if this channel is connected.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		override public function get connected():Boolean
+		{
+			return true;
+		}
+		
+		/**
+		 *  Indicates the protocol used by this channel.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		override public function get protocol():String
+		{
+			return "http";     
+		}
+		
+		//----------------------------------
+		//  realtime
+		//----------------------------------
+		
+		/**
+		 *  @private
+		 *  Returns true if the channel supports realtime behavior via server push or client poll.
+		 */
+		override mx_internal function get realtime():Boolean
+		{
+			return false;
+		}    
+		
+		/**
+		 *  @private
+		 *  Because this channel is always "connected", we ignore any connect timeout
+		 *  that is reported.
+		 */
+		/*
+		override protected function connectTimeoutHandler(event:TimerEvent):void
+		{
+			// Ignore.
+		}
+		*/
+
+		/**
+		 *  Returns the appropriate MessageResponder for the Channel.
+		 *
+		 *  @param agent The MessageAgent sending the message.
+		 * 
+		 *  @param message The IMessage to send.
+		 * 
+		 *  @return The MessageResponder to handle the send result or fault.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		
+		override protected function getMessageResponder(agent:MessageAgent, 
+														message:IMessage):MessageResponder
+		{
+			return new DirectHTTPMessageResponder(agent, message, this, new URLLoader());
+		}
+
+		/**
+		 *  Because this channel doesn't participate in hunting we will always assume
+		 *  that we have connected.
+		 *
+		 *  @private
+		 */
+		override protected function internalConnect():void
+		{
+			connectSuccess();
+		}
+		
+		override protected function internalSend(msgResp:MessageResponder):void
+		{
+			var httpMsgResp:DirectHTTPMessageResponder = DirectHTTPMessageResponder(msgResp);
+			var urlRequest:URLRequest;
+			
+			try
+			{
+				urlRequest = createURLRequest(httpMsgResp.message);
+			}
+			catch(e: MessageSerializationError)
+			{
+				httpMsgResp.agent.fault(e.fault, httpMsgResp.message);
+				return;
+			}
+			
+			var urlLoader:URLLoader = httpMsgResp.urlLoader;
+			urlLoader.addEventListener(ErrorEvent.ERROR, httpMsgResp.errorHandler);
+			urlLoader.addEventListener(IOErrorEvent.IO_ERROR, httpMsgResp.errorHandler);
+			urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, httpMsgResp.securityErrorHandler);
+			urlLoader.addEventListener(Event.COMPLETE, httpMsgResp.completeHandler);
+			urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpMsgResp.httpStatusHandler);
+			urlLoader.load(urlRequest);
+		}
+
+		/**
+		 * @private
+		 */
+		
+		/*override */
+		mx_internal function createURLRequest(message:IMessage):URLRequest
+		{
+			var httpMsg:HTTPRequestMessage = HTTPRequestMessage(message);
+			var result:URLRequest = new URLRequest();
+			var url:String = httpMsg.url;
+			var params:String = null;
+			
+			// Propagate our requestTimeout for those platforms
+			// supporting the idleTimeout property on URLRequest.
+			if ("idleTimeout" in result && requestTimeout > 0)
+				result["idleTimeout"] = requestTimeout * 1000;
+			
+			result.contentType = httpMsg.contentType;
+			
+			var contentTypeIsXML:Boolean = 
+				result.contentType == HTTPRequestMessage.CONTENT_TYPE_XML 
+				|| result.contentType == HTTPRequestMessage.CONTENT_TYPE_SOAP_XML;
+			
+			var headers:Object = httpMsg.httpHeaders;
+			if (headers)
+			{
+				var requestHeaders:Array = [];
+				var header:URLRequestHeader;
+				for (var h:String in headers)
+				{
+					header = new URLRequestHeader(h, headers[h]);
+					requestHeaders.push(header);
+				}
+				result.requestHeaders = requestHeaders;
+			}
+			
+			if (!contentTypeIsXML)
+			{
+				COMPILE::SWF {
+					var urlVariables:flash.net.URLVariables = new flash.net.URLVariables();
+				}
+				COMPILE::JS {
+					var urlVariables:URLVariables = new URLVariables();
+				}
+				var body:Object = httpMsg.body;
+				for (var p:String in body)
+					urlVariables[p] = httpMsg.body[p];
+				
+				params = urlVariables.toString();
+			}
+			
+			if (httpMsg.method == HTTPRequestMessage.POST_METHOD || contentTypeIsXML)
+			{
+				result.method = "POST";
+				if (result.contentType == HTTPRequestMessage.CONTENT_TYPE_FORM)
+					result.data = params;
+				else
+				{
+					// For XML content, work around bug 196450 by calling 
+					// XML.toXMLString() ourselves as URLRequest.data uses
+					// XML.toString() hence bug 184950.
+					if (httpMsg.body != null && httpMsg.body is XML)
+						result.data = XML(httpMsg.body).toXMLString();
+					else
+						result.data = httpMsg.body;
+				}
+			}
+			else
+			{
+				if (params && params != "")
+				{
+					url += (url.indexOf("?") > -1) ? '&' : '?';
+					url += params;
+				}
+			}
+			result.url = url;
+			
+			if (NetworkMonitor.isMonitoring())
+			{
+				// NetworkMonitor.adjustURLRequest(result, LoaderConfig.url, message.messageId);
+			}
+			
+			return result;
+		}
+		
+		override public function setCredentials(credentials:String, agent:MessageAgent=null, charset:String=null):void
+		{
+			var message:String = resourceManager.getString(
+				"messaging", "authenticationNotSupported");
+			throw new ChannelError(message);
+		}
+		
+		/**
+		 * @private
+		 * Incremented per new instance of the channel to create clientIds.
+		 */
+		private static var clientCounter:uint;
+	}
+}
+
+COMPILE::SWF
+{
+	import flash.events.Event;
+	import flash.events.ErrorEvent;
+	import flash.events.IOErrorEvent;
+	import flash.events.SecurityErrorEvent;
+	import flash.net.URLLoader;
+	import flash.events.HTTPStatusEvent;
+}
+
+COMPILE::JS
+{
+	import org.apache.royale.events.Event;
+	import mx.events.ErrorEvent;
+	import mx.events.IOErrorEvent;
+	import mx.events.SecurityErrorEvent;
+	import org.apache.royale.net.URLLoader;
+	import mx.events.HTTPStatusEvent;
+}
+
+import mx.core.mx_internal;
+import mx.messaging.MessageAgent;
+import mx.messaging.MessageResponder;
+import mx.messaging.channels.DirectHTTPChannel;
+import mx.messaging.messages.AbstractMessage;
+import mx.messaging.messages.AcknowledgeMessage;
+import mx.messaging.messages.HTTPRequestMessage;
+import mx.messaging.messages.ErrorMessage;
+import mx.messaging.messages.IMessage;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+
+use namespace mx_internal;
+
+[ResourceBundle("messaging")]
+
+/**
+ *  @private
+ *  This is an adapter for url loader that is used by the HTTPChannel.
+ */
+class DirectHTTPMessageResponder extends MessageResponder
+{
+	//--------------------------------------------------------------------------
+	//
+	// Constructor
+	// 
+	//--------------------------------------------------------------------------    
+	
+	/**
+	 *  Constructs a DirectHTTPMessageResponder.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion BlazeDS 4
+	 *  @productversion LCDS 3 
+	 */
+	public function DirectHTTPMessageResponder(agent:MessageAgent, msg:IMessage, 
+											   channel:DirectHTTPChannel, urlLoader:URLLoader)
+	{
+		super(agent, msg, channel);
+		this.urlLoader = urlLoader;
+		clientId = channel.clientId;
+	}
+	
+	//--------------------------------------------------------------------------
+	//
+	// Variables
+	// 
+	//--------------------------------------------------------------------------
+	
+	/**
+	 * @private
+	 */
+	private var clientId:String;
+	
+	/**
+	 * @private
+	 */
+	private var lastStatus:int;
+	
+	/**
+	 * @private
+	 */
+	private var resourceManager:IResourceManager = ResourceManager.getInstance();
+	
+	/**
+	 *  The URLLoader associated with this responder.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion BlazeDS 4
+	 *  @productversion LCDS 3 
+	 */
+	public var urlLoader:URLLoader;
+	
+	//--------------------------------------------------------------------------
+	//
+	// Methods
+	// 
+	//--------------------------------------------------------------------------    
+	
+	/**
+	 *  @private
+	 */
+	public function errorHandler(event:Event):void
+	{
+		status(null);
+		// send the ack
+		var ack:AcknowledgeMessage = new AcknowledgeMessage();
+		ack.clientId = clientId;
+		ack.correlationId = message.messageId;
+		ack.headers[AcknowledgeMessage.ERROR_HINT_HEADER] = true; // hint there was an error
+		agent.acknowledge(ack, message);
+		// send fault
+		var msg:ErrorMessage = new ErrorMessage();
+		msg.clientId = clientId;
+		msg.correlationId = message.messageId;
+		msg.faultCode = "Server.Error.Request";
+		msg.faultString = resourceManager.getString(
+			"messaging", "httpRequestError");
+		var details:String = event.toString();
+		if (message is HTTPRequestMessage)
+		{
+			details += ". URL: ";
+			details += HTTPRequestMessage(message).url;
+		}
+		msg.faultDetail = resourceManager.getString(
+			"messaging", "httpRequestError.details", [ details ]);
+		msg.rootCause = event;
+		msg.body = URLLoader(event.target).data;
+		msg.headers[AbstractMessage.STATUS_CODE_HEADER] = lastStatus;
+		agent.fault(msg, message);
+	}
+	
+	/**
+	 *  @private
+	 */
+	public function securityErrorHandler(event:Event):void
+	{
+		status(null);
+		// send the ack
+		var ack:AcknowledgeMessage = new AcknowledgeMessage();
+		ack.clientId = clientId;
+		ack.correlationId = message.messageId;
+		ack.headers[AcknowledgeMessage.ERROR_HINT_HEADER] = true; // hint there was an error
+		agent.acknowledge(ack, message);
+		// send fault
+		var msg:ErrorMessage = new ErrorMessage();
+		msg.clientId = clientId;
+		msg.correlationId = message.messageId;
+		msg.faultCode = "Channel.Security.Error";
+		msg.faultString = resourceManager.getString(
+			"messaging", "securityError");
+		msg.faultDetail = resourceManager.getString(
+			"messaging", "securityError.details", [ message.destination ]);
+		msg.rootCause = event;
+		msg.body = URLLoader(event.target).data;
+		msg.headers[AbstractMessage.STATUS_CODE_HEADER] = lastStatus;
+		agent.fault(msg, message);
+	}
+	
+	/**
+	 *  @private
+	 */
+	public function completeHandler(event:Event):void
+	{
+		result(null);
+		var ack:AcknowledgeMessage = new AcknowledgeMessage();
+		ack.clientId = clientId;
+		ack.correlationId = message.messageId;
+		ack.body = URLLoader(event.target).data;
+		ack.headers[AbstractMessage.STATUS_CODE_HEADER] = lastStatus;
+		agent.acknowledge(ack, message);
+	}
+	
+	/**
+	 *  @private
+	 */
+	
+	public function httpStatusHandler(event:HTTPStatusEvent):void
+	{	
+		COMPILE::SWF {
+			lastStatus = event.status;
+		}
+	}
+
+	/**
+	 *  Handle a request timeout by closing our associated URLLoader and
+	 *  faulting the message to the agent.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion BlazeDS 4
+	 *  @productversion LCDS 3 
+	 */
+
+	override protected function requestTimedOut():void
+	{
+		urlLoader.removeEventListener(ErrorEvent.ERROR, errorHandler);
+		urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
+		urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
+		urlLoader.removeEventListener(Event.COMPLETE, completeHandler);
+		urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
+		// urlLoader.close();
+		
+		status(null);
+		// send the ack
+		var ack:AcknowledgeMessage = new AcknowledgeMessage();
+		ack.clientId = clientId;
+		ack.correlationId = message.messageId;
+		ack.headers[AcknowledgeMessage.ERROR_HINT_HEADER] = true; // hint there was an error
+		agent.acknowledge(ack, message);
+		// send the fault
+		agent.fault(createRequestTimeoutErrorMessage(), message);
+	}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/URLVariables.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/URLVariables.as
new file mode 100644
index 000000000..99d8ff339
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/URLVariables.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.messaging.channels
+{
+	public class URLVariables 
+	{
+		public function URLVariables(source:String = null)
+		{
+		}
+		
+		public function decode(source:String):void
+		{
+		}
+		
+		public function toString():String
+		{
+			return "";
+		}	
+	}
+}
\ No newline at end of file
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/errors/MessageSerializationError.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/errors/MessageSerializationError.as
new file mode 100644
index 000000000..25e6242cb
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/errors/MessageSerializationError.as
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.messaging.errors
+{
+	
+	import mx.messaging.messages.ErrorMessage;
+	
+	/**
+	 *  This error indicates a problem serializing a message within a channel.
+	 *  It provides a fault property which corresponds to an ErrorMessage generated
+	 *  when this error is thrown.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion BlazeDS 4
+	 *  @productversion LCDS 3 
+	 */
+	public class MessageSerializationError extends MessagingError
+	{
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructs a new instance of the MessageSerializationError
+		 *  with the specified message.
+		 *
+		 *  @param msg String that contains the message that describes the error.
+		 *  @param fault Provides specific information about the fault that occured
+		 *  and for which message.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		public function MessageSerializationError(msg:String, fault:ErrorMessage)
+		{
+			super(msg);
+			this.fault = fault;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Variables
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Provides specific information about the fault that occurred and for
+		 *  which message.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3 
+		 */
+		public var fault:ErrorMessage;
+	}
+	
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/messages/HTTPRequestMessage.as b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/messages/HTTPRequestMessage.as
new file mode 100644
index 000000000..0660892fe
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/messages/HTTPRequestMessage.as
@@ -0,0 +1,411 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.messaging.messages
+{
+
+// import mx.resources.IResourceManager;
+// import mx.resources.ResourceManager;
+
+// [ResourceBundle("messaging")]
+
+[RemoteClass(alias="flex.messaging.messages.HTTPMessage")]
+
+/**
+ *  HTTP requests are sent to the HTTP endpoint using this message type.
+ *  An HTTPRequestMessage encapsulates content and header information normally
+ *  found in HTTP requests made by a browser.
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion BlazeDS 4
+ *  @productversion LCDS 3 
+ */
+public class HTTPRequestMessage extends AbstractMessage
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    // 
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructs an uninitialized HTTP request.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public function HTTPRequestMessage()
+    {
+        super();
+        _method = GET_METHOD;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    // 
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Indicates the content type of this message.
+     *  This value must be understood by the destination this request is sent to.
+     *
+     *  <p>The following example sets the <code>contentType</code> property:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public var contentType:String;
+
+    /**
+     *  Contains specific HTTP headers that should be placed on the request made
+     *  to the destination.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public var httpHeaders:Object;
+    
+    /**
+     * Only used when going through the proxy, should the proxy 
+     * send back the request and response headers it used.  Defaults to false.
+     * Currently only set when using the NetworkMonitor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public var recordHeaders:Boolean;    
+    
+    [Inspectable(defaultValue="undefined", category="General")]
+    /**
+     *  Contains the final destination for this request.
+     *  This is the URL that the content of this message, found in the
+     *  <code>body</code> property, will be sent to, using the method specified.
+     *
+     *  <p>The following example sets the <code>url</code> property:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public var url:String;    
+
+    /**
+     *  @private
+    private var resourceManager:IResourceManager =
+                                    ResourceManager.getInstance();
+     */
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    // 
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  method
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _method:String;
+
+    [Inspectable(category="General")]
+    /**
+     *  Indicates what method should be used for the request.
+     *  The only values allowed are:
+     *  <ul>
+     *    <li><code>HTTPRequestMessage.DELETE_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.GET_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.HEAD_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.POST_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.OPTIONS_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.PUT_METHOD</code></li>
+     *    <li><code>HTTPRequestMessage.TRACE_METHOD</code></li>
+     *  </ul>
+     *
+     *  <p>The following example sets the <code>method</code> property:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public function get method():String
+    {
+        return _method;
+    }
+
+    /**
+     *  @private
+     */
+    public function set method(value:String):void
+    {
+        /*
+        if (VALID_METHODS.indexOf(value) == -1)
+        {
+            var message:String = resourceManager.getString(
+                "messaging", "invalidRequestMethod");
+            throw new ArgumentError(message);
+        }
+        */
+
+        _method = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Static Constants
+    // 
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  Indicates that the content of this message is XML.
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_XML;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const CONTENT_TYPE_XML:String = "application/xml";
+    
+    /**
+     *  Indicates that the content of this message is a form.
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const CONTENT_TYPE_FORM:String = "application/x-www-form-urlencoded";
+    
+    /**
+     *  Indicates that the content of this message is XML meant for a SOAP
+     *  request.
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_SOAP_XML;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const CONTENT_TYPE_SOAP_XML:String = "text/xml; charset=utf-8";
+
+    /**
+     *  Indicates that the method used for this request should be "post".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.POST_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const POST_METHOD:String = "POST";
+
+    /**
+     *  Indicates that the method used for this request should be "get".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.GET_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const GET_METHOD:String = "GET";
+
+    /**
+     *  Indicates that the method used for this request should be "put".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.PUT_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const PUT_METHOD:String = "PUT";
+
+    /**
+     *  Indicates that the method used for this request should be "head".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.HEAD_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const HEAD_METHOD:String = "HEAD";
+
+    /**
+     *  Indicates that the method used for this request should be "delete".
+     *  
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.DELETE_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const DELETE_METHOD:String = "DELETE";
+
+    /**
+     *  Indicates that the method used for this request should be "options".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.OPTIONS_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const OPTIONS_METHOD:String = "OPTIONS";
+
+    /**
+     *  Indicates that the method used for this request should be "trace".
+     *
+     *  <p>The following example uses this constant:</p>
+     *    <pre>
+     *      var msg:HTTPRequestMessage = new HTTPRequestMessage();
+     *      msg.contentType = HTTPRequestMessage.CONTENT_TYPE_FORM;
+     *      msg.method = HTTPRequestMessage.TRACE_METHOD;
+     *      msg.url = "http://my.company.com/login";
+     *    </pre>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion BlazeDS 4
+     *  @productversion LCDS 3 
+     */
+    public static const TRACE_METHOD:String = "TRACE";
+
+    /**
+     *  @private
+     */
+    private static const VALID_METHODS:String = "POST,PUT,GET,HEAD,DELETE,OPTIONS,TRACE";       
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/AbstractOperation.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/AbstractOperation.as
new file mode 100644
index 000000000..39f40fb44
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/AbstractOperation.as
@@ -0,0 +1,1215 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.rpc.http
+{
+	// import flash.utils.getQualifiedClassName;
+	// import flash.xml.XMLDocument;
+	// import flash.xml.XMLNode;
+		
+	import mx.collections.ArrayCollection;
+	import mx.core.mx_internal;
+	import mx.logging.ILogger;
+	import mx.logging.Log;
+	// import mx.managers.CursorManager;
+	import mx.messaging.ChannelSet;
+	import mx.messaging.channels.DirectHTTPChannel;
+	import mx.messaging.config.LoaderConfig;
+	import mx.messaging.events.MessageEvent;
+	import mx.messaging.messages.AsyncMessage;
+	import mx.messaging.messages.HTTPRequestMessage;
+	import mx.netmon.NetworkMonitor;
+	import mx.messaging.messages.IMessage;
+	import mx.resources.IResourceManager;
+	import mx.resources.ResourceManager;
+	import mx.rpc.AbstractService;
+	import mx.rpc.AsyncDispatcher;
+	import mx.rpc.AsyncToken;
+	import mx.rpc.Fault;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.mxml.Concurrency;
+	// import mx.rpc.xml.SimpleXMLDecoder;
+	// import mx.rpc.xml.SimpleXMLEncoder;
+	import mx.utils.ObjectProxy;
+	import mx.utils.ObjectUtil;
+	import mx.utils.StringUtil;
+	import mx.utils.URLUtil;
+	
+	import mx.messaging.errors.ArgumentError;
+	
+	use namespace mx_internal;
+	
+	/**
+	 * An Operation used specifically by HTTPService or HTTPMultiService.  An Operation is an 
+	 * individual operation on a service usually corresponding to a single operation on the server
+	 * side.  An Operation can be called either by invoking the
+	 * function of the same name on the service or by accessing the Operation as a property on the service and
+	 * calling the <code>send(param1, param2)</code> method.  HTTP services also support a sendBody
+	 * method which allows you to directly specify the body of the HTTP response.  If you use the
+	 * send(param1, param2) method, the body is typically formed by combining the argumentNames
+	 * property of the operation with the parameters sent.  An Object is created which uses the
+	 * argumentNames[i] as the key and the corresponding parameter as the value.
+	 * 
+	 * <p>The exact way in which the HTTP operation arguments is put into the HTTP body is determined
+	 * by the serializationFilter used.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class AbstractOperation extends mx.rpc.AbstractOperation
+	{
+		//---------------------------------
+		// Constructor
+		//---------------------------------
+		
+		/**
+		 *  Creates a new Operation. 
+		 * 
+		 *  @param service The object defining the type of service, such as 
+		 *  HTTPMultiService, WebService, or RemoteObject.
+		 *
+		 *  @param name The name of the service.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 
+		 *  Creates a new Operation. 
+		 *
+		 *  @param service The object defining the type of service, such as 
+		 *  HTTPMultiService, WebService, or RemoteObject.
+		 *
+		 *  @param name The name of the service.
+		 */
+		public function AbstractOperation(service:AbstractService=null, name:String=null)
+		{
+			super(service, name);
+			
+			_log = Log.getLogger("mx.rpc.http.HTTPService");
+			
+			concurrency = Concurrency.MULTIPLE;
+		}
+		
+		/**
+		 *  The result format "e4x" specifies that the value returned is an XML instance, which can be accessed using ECMAScript for XML (E4X) expressions.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const RESULT_FORMAT_E4X:String = "e4x";
+		
+		/**
+		 *  The result format "flashvars" specifies that the value returned is text containing name=value pairs
+		 *  separated by ampersands, which is parsed into an ActionScript object.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const RESULT_FORMAT_FLASHVARS:String = "flashvars";
+		
+		/**
+		 *  The result format "object" specifies that the value returned is XML but is parsed as a tree of ActionScript objects. This is the default.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const RESULT_FORMAT_OBJECT:String = "object";
+		
+		/**
+		 *  The result format "array" is similar to "object" however the value returned is always an Array such
+		 *  that if the result returned from result format "object" is not an Array already the item will be
+		 *  added as the first item to a new Array.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const RESULT_FORMAT_ARRAY:String = "array";
+		
+		/**
+		 *  The result format "text" specifies that the HTTPService result text should be an unprocessed String.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const RESULT_FORMAT_TEXT:String = "text";
+		
+		/**
+		 *  The result format "xml" specifies that results should be returned as an flash.xml.XMLNode instance pointing to
+		 *  the first child of the parent flash.xml.XMLDocument.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		// mx_internal static const RESULT_FORMAT_XML:String = "xml";
+		
+		/**
+		 *  Indicates that the data being sent by the HTTP service is encoded as application/xml.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const CONTENT_TYPE_XML:String = "application/xml";
+		
+		/**
+		 *  Indicates that the data being sent by the HTTP service is encoded as application/x-www-form-urlencoded.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		mx_internal static const CONTENT_TYPE_FORM:String = "application/x-www-form-urlencoded";
+		
+		// Constants for error codes
+		/**
+		 *  Indicates that the useProxy property was set to false but a url was not provided.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		private static const ERROR_URL_REQUIRED:String = "Client.URLRequired";
+		
+		/**
+		 *  Indicates that an XML formatted result could not be parsed into an XML instance
+		 *  or decoded into an Object.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		private static const ERROR_DECODING:String = "Client.CouldNotDecode";
+		
+		/**
+		 *  Indicates that an input parameter could not be encoded as XML.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		private static const ERROR_ENCODING:String = "Client.CouldNotEncode";    
+		
+		//---------------------------------
+		// Properties
+		//---------------------------------
+		
+		/**
+		 * An ordered list of the names of the arguments to pass to a method invocation.  Since the arguments object is
+		 * a hashmap with no guaranteed ordering, this array helps put everything together correctly.
+		 * It will be set automatically by the MXML compiler, if necessary, when the Operation is used in tag form.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var argumentNames:Array;
+		
+		//----------------------------------
+		//  method
+		//----------------------------------
+		
+		[Inspectable(enumeration="GET,get,POST,post,HEAD,head,OPTIONS,options,PUT,put,TRACE,trace,DELETE,delete", defaultValue="GET", category="General")]
+		/**
+		 *  HTTP method for sending the request. Permitted values are <code>GET</code>, <code>POST</code>, <code>HEAD</code>,
+		 *  <code>OPTIONS</code>, <code>PUT</code>, <code>TRACE</code> and <code>DELETE</code>.
+		 *  Lowercase letters are converted to uppercase letters. The default value is <code>GET</code>.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get method():String
+		{
+			return _method;
+		}
+		public function set method(m:String):void
+		{
+			_method = m;
+		}
+		
+		[Inspectable(enumeration="multiple,single,last", defaultValue="multiple", category="General")]
+		/**
+		 * Value that indicates how to handle multiple calls to the same service. The default
+		 * value is <code>multiple</code>. The following values are permitted:
+		 * <ul>
+		 * <li><code>multiple</code> Existing requests are not cancelled, and the developer is
+		 * responsible for ensuring the consistency of returned data by carefully
+		 * managing the event stream. This is the default value.</li>
+		 * <li><code>single</code> Only a single request at a time is allowed on the operation;
+		 * multiple requests generate a fault.</li>
+		 * <li><code>last</code> Making a request cancels any existing request.</li>
+		 * </ul>
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get concurrency():String
+		{
+			return _concurrency;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set concurrency(c:String):void
+		{
+			_concurrency = c;
+		}
+		
+		//----------------------------------
+		//  requestTimeout
+		//----------------------------------
+		
+		/**
+		 *  @private
+		 */
+		private var _requestTimeout:int = -1;
+		
+		/**
+		 *  Provides access to the request timeout in seconds for sent messages.
+		 *  If an acknowledgement, response or fault is not received from the
+		 *  remote destination before the timeout is reached the message is faulted
+		 *  on the client. A value less than or equal to zero prevents request timeout.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion BlazeDS 4
+		 *  @productversion LCDS 3           
+		 */
+		public function get requestTimeout():int
+		{
+			return _requestTimeout;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set requestTimeout(value:int):void
+		{
+			if (_requestTimeout != value)
+				_requestTimeout = value;
+		}
+		
+		/**
+		 *  @private
+		 */
+		private var _resultFormat:String = RESULT_FORMAT_OBJECT;
+		
+		[Inspectable(enumeration="object,array,xml,flashvars,text,e4x", category="General")]
+		/**
+		 *  Value that indicates how you want to deserialize the result
+		 *  returned by the HTTP call. The value for this is based on the following:
+		 *  <ul>
+		 *  <li>Whether you are returning XML or name/value pairs.</li>
+		 *  <li>How you want to access the results; you can access results as an object,
+		 *    text, or XML.</li>
+		 *  </ul>
+		 * 
+		 *  <p>The default value is <code>object</code>. The following values are permitted:</p>
+		 *  <ul>
+		 *  <li><code>object</code> The value returned is XML and is parsed as a tree of ActionScript
+		 *    objects. This is the default.</li>
+		 *  <li><code>array</code> The value returned is XML and is parsed as a tree of ActionScript
+		 *    objects however if the top level object is not an Array, a new Array is created and the result
+		 *    set as the first item. If makeObjectsBindable is true then the Array 
+		 *    will be wrapped in an ArrayCollection.</li>
+		 *  <li><code>xml</code> The value returned is XML and is returned as literal XML in an
+		 *    ActionScript XMLnode object.</li>
+		 *  <li><code>flashvars</code> The value returned is text containing 
+		 *    name=value pairs separated by ampersands, which
+		 *  is parsed into an ActionScript object.</li>
+		 *  <li><code>text</code> The value returned is text, and is left raw.</li>
+		 *  <li><code>e4x</code> The value returned is XML and is returned as literal XML 
+		 *    in an ActionScript XML object, which can be accessed using ECMAScript for 
+		 *    XML (E4X) expressions.</li>
+		 *  </ul>
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get resultFormat():String
+		{
+			return _resultFormat;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set resultFormat(value:String):void
+		{
+			switch (value)
+			{
+				case RESULT_FORMAT_OBJECT:
+				case RESULT_FORMAT_ARRAY:
+					//case RESULT_FORMAT_XML:
+				case RESULT_FORMAT_E4X:
+				case RESULT_FORMAT_TEXT:
+				case RESULT_FORMAT_FLASHVARS:
+				{
+					break;
+				}
+					
+				default:
+				{
+					var sf:SerializationFilter;
+					if (value != null && (sf = SerializationFilter.filterForResultFormatTable[value]) == null)
+					{
+						// TODO: share this code with HTTPService, HTTPMultiService?  Also
+						// improve the error/asdoc to include discussion of the SerializationFilter
+						// and in the error display the contents of the SerializationFilter.filterForResultFormatTable
+						// to make it clear which SerializationFormats are available in the current
+						// context.
+						var message:String = resourceManager.getString(
+							"rpc", "invalidResultFormat",
+							[ value, RESULT_FORMAT_OBJECT, RESULT_FORMAT_ARRAY,
+								/*RESULT_FORMAT_XML, */RESULT_FORMAT_E4X,
+								RESULT_FORMAT_TEXT, RESULT_FORMAT_FLASHVARS ]);
+						throw new ArgumentError(message);
+					}
+					serializationFilter = sf;
+				}
+			}
+			_resultFormat = value;
+		}
+		
+		/**
+		 * A SerializationFilter can control how the arguments are formatted to form the content
+		 * of the HTTP request.  It also controls how the results are converted into ActionScript
+		 * objects.  It can be set either explicitly using this property or indirectly using the
+		 * resultFormat property.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var serializationFilter:SerializationFilter;
+		
+		/** 
+		 *  Returns the serialization filter.
+		 *  Subclasses can override this method to control 
+		 *  the retrieval of the HTTP request headers. 
+		 *
+		 *  @return The serialization filter.
+		 */
+		protected function getSerializationFilter():SerializationFilter
+		{
+			return serializationFilter;
+		}
+		
+		//----------------------------------
+		//  request
+		//----------------------------------
+		
+		[Inspectable(defaultValue="undefined", category="General")]
+		/**
+		 *  Object of name-value pairs used as parameters to the URL. If
+		 *  the <code>contentType</code> property is set to <code>application/xml</code>, it should be an XML document.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var request:Object = {};
+		
+		
+		//----------------------------------
+		//  url
+		//----------------------------------
+		
+		/**
+		 *  @private
+		 */
+		private var _url:String;
+		
+		[Inspectable(defaultValue="undefined", category="General")]
+		/**
+		 *  Location of the service. If you specify the <code>url</code> and a non-default destination,
+		 *  your destination in the services-config.xml file must allow the specified URL.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get url():String
+		{
+			return _url;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set url(value:String):void
+		{
+			_url = value;
+		}
+		
+		//----------------------------------
+		//  useProxy
+		//----------------------------------
+		
+		/**
+		 *  @private
+		 */
+		private var _useProxy:Boolean = false;
+		
+		[Inspectable(defaultValue="false", category="General")]
+		/**
+		 *  Specifies whether to use the Flex proxy service. The default value is <code>false</code>. If you
+		 *  do not specify <code>true</code> to proxy requests though the Flex server, you must ensure that the player 
+		 *  can reach the target URL. You also cannot use destinations defined in the services-config.xml file if the
+		 *  <code>useProxy</code> property is set to <code>false</code>.
+		 *
+		 *  @default false    
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get useProxy():Boolean
+		{
+			return _useProxy;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set useProxy(value:Boolean):void
+		{
+			if (value != _useProxy)
+			{
+				_useProxy = value;
+				var dcs:ChannelSet = getDirectChannelSet();
+				if (!useProxy)
+				{
+					if (dcs != asyncRequest.channelSet)
+						asyncRequest.channelSet = dcs;
+				}
+				else
+				{
+					if (asyncRequest.channelSet == dcs)
+						asyncRequest.channelSet = null;
+				}
+			}
+		}
+		
+		//----------------------------------
+		//  xmlDecode
+		//----------------------------------
+		
+		[Inspectable(defaultValue="undefined", category="General")]
+		/**
+		 *  ActionScript function used to decode a service result from XML.
+		 *  When the <code>resultFormat</code> is an object and the <code>xmlDecode</code> property is set,
+		 *  Flex uses the XML that the HTTPService returns to create an
+		 *  Object. If it is not defined the default XMLDecoder is used
+		 *  to do the work.
+		 *  <p>The function referenced by the <code>xmlDecode</code> property must
+		 *  take a flash.xml.XMLNode object as a parameter and should return
+		 *  an Object. It can return any type of object, but it must return
+		 *  something. Returning <code>null</code> or <code>undefined</code> causes a fault.</p>
+		 
+		 The following example shows an &lt;mx:HTTPService&gt; tag that specifies an xmlDecode function:
+		 
+		 <pre>
+		 &lt;mx:HTTPService id="hs" xmlDecode="xmlDecoder" url="myURL" resultFormat="object" contentType="application/xml"&gt;
+		 &lt;mx:request&gt;&lt;source/&gt;
+		 &lt;obj&gt;{RequestObject}&lt;/obj&gt;
+		 &lt;/mx:request&gt;
+		 &lt;/mx:HTTPService&gt;
+		 </pre>
+		 
+		 
+		 The following example shows an xmlDecoder function:
+		 <pre>
+		 function xmlDecoder (myXML)
+		 {
+		 // Simplified decoding logic.
+		 var myObj = {};
+		 myObj.name = myXML.firstChild.nodeValue;
+		 myObj.honorific = myXML.firstChild.attributes.honorific;
+		 return myObj;
+		 }
+		 </pre>
+		 
+		 *  
+		 
+		 *  @langversion 3.0
+		 
+		 *  @playerversion Flash 9
+		 
+		 *  @playerversion AIR 1.1
+		 
+		 *  @productversion Flex 3
+		 
+		 */
+		public var xmlDecode:Function;
+		
+		//----------------------------------
+		//  xmlEncode
+		//----------------------------------
+		
+		[Inspectable(defaultValue="undefined", category="General")]
+		/**
+		 *  ActionScript function used to encode a service request as XML.
+		 *  When the <code>contentType</code> of a request is <code>application/xml</code> and the
+		 *  request object passed in is an Object, Flex attempts to use
+		 *  the function specified in the <code>xmlEncode</code> property to turn it
+		 *  into a flash.xml.XMLNode object If the <code>xmlEncode</code> property is not set, 
+		 *  Flex uses the default
+		 *  XMLEncoder to turn the object graph into a flash.xml.XMLNode object.
+		 * 
+		 *  <p>The <code>xmlEncode</code> property takes an Object and should return
+		 *  a flash.xml.XMLNode object. In this case, the XMLNode object can be a flash.xml.XML object,
+		 *  which is a subclass of XMLNode, or the first child of the
+		 *  flash.xml.XML object, which is what you get from an <code>&lt;mx:XML&gt;</code> tag.
+		 *  Returning the wrong type of object causes a fault.
+		 *  The following example shows an &lt;mx:HTTPService&gt; tag that specifies an xmlEncode function:</p>
+		 
+		 <pre>
+		 &lt;mx:HTTPService id="hs" xmlEncode="xmlEncoder" url="myURL" resultFormat="object" contentType="application/xml"&gt;
+		 &lt;mx:request&gt;&lt;source/&gt;
+		 &lt;obj&gt;{RequestObject}&lt;/obj&gt;
+		 &lt;/mx:request&gt;
+		 &lt;/mx:HTTPService&gt;
+		 </pre>
+		 
+		 
+		 The following example shows an xmlEncoder function:
+		 <pre>
+		 function xmlEncoder (myObj)
+		 {
+		 return new XML("<userencoded><attrib0>MyObj.test</attrib0>
+		 <attrib1>MyObj.anotherTest</attrib1></userencoded>");
+		 }
+		 </pre>
+		 
+		 *  
+		 
+		 *  @langversion 3.0
+		 
+		 *  @playerversion Flash 9
+		 
+		 *  @playerversion AIR 1.1
+		 
+		 *  @productversion Flex 3
+		 
+		 */
+		public var xmlEncode:Function;
+		
+		//----------------------------------
+		//  headers
+		//----------------------------------
+		
+		[Inspectable(defaultValue="undefined", category="General")]
+		/**
+		 *  Custom HTTP headers to be sent to the third party endpoint. If multiple headers need to
+		 *  be sent with the same name the value should be specified as an Array.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var headers:Object = {};
+		
+		//----------------------------------
+		//  contentType
+		//----------------------------------
+		
+		// These are not all of the allowed values and mxmlc is now enforcing the value is in this list.  We could add this back if
+		// there was wildcard support.
+		//[Inspectable(enumeration="application/x-www-form-urlencoded,application/xml", defaultValue="application/x-www-form-urlencoded", category="General")]
+		
+		private var _contentType:String = CONTENT_TYPE_FORM;
+		/**
+		 *  Type of content for service requests. 
+		 *  The default is <code>application/x-www-form-urlencoded</code> which sends requests
+		 *  like a normal HTTP POST with name-value pairs. <code>application/xml</code> send
+		 *  requests as XML.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get contentType():String
+		{
+			return _contentType;
+		}
+		public function set contentType(ct:String):void
+		{
+			_contentType = ct;
+		}
+		
+		//----------------------------------
+		//  showBusyCursor
+		//----------------------------------
+		
+		[Inspectable(defaultValue="false", category="General")]
+		/**
+		 * If <code>true</code>, a busy cursor is displayed while a service is executing. The default
+		 * value is <code>false</code>.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get showBusyCursor():Boolean
+		{
+			return _showBusyCursor;
+		}
+		
+		public function set showBusyCursor(sbc:Boolean):void
+		{
+			_showBusyCursor = sbc;
+		}
+		
+		//----------------------------------
+		//  rootURL
+		//----------------------------------
+		
+		/**
+		 *  @private
+		 */
+		mx_internal var _rootURL:String;
+		
+		/**
+		 *  The URL that the HTTPService object should use when computing relative URLs.
+		 *  This property is only used when going through the proxy.
+		 *  When the <code>useProxy</code> property is set to <code>false</code>, the relative URL is computed automatically
+		 *  based on the location of the SWF running this application.
+		 *  If not set explicitly <code>rootURL</code> is automatically set to the URL of
+		 *  mx.messaging.config.LoaderConfig.url.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function get rootURL():String
+		{
+			if (_rootURL == null)
+			{
+				_rootURL = LoaderConfig.url;
+			}
+			return _rootURL;
+		}
+		
+		/**
+		 *  @private
+		 */
+		public function set rootURL(value:String):void
+		{
+			_rootURL = value;
+		}
+		
+		//---------------------------------
+		// Methods
+		//---------------------------------
+		
+		/**
+		 * @private
+		 */
+		override public function cancel(id:String = null):AsyncToken
+		{
+			if (showBusyCursor)
+			{
+				// CursorManager.removeBusyCursor();
+			}
+			return super.cancel(id);
+		}
+		
+		public function sendBody(parameters:Object):AsyncToken
+		{
+			var filter:SerializationFilter = getSerializationFilter();
+			
+			var paramsToSend:Object;
+			var token:AsyncToken;
+			var fault:Fault;
+			var faultEvent:FaultEvent;
+			var msg:String;
+			
+			//concurrency check
+			if (Concurrency.SINGLE == concurrency && activeCalls.hasActiveCalls())
+			{
+				token = new AsyncToken(null);
+				var m:String = resourceManager.getString(
+					"rpc", "pendingCallExists");
+				fault = new Fault("ConcurrencyError", m);
+				faultEvent = FaultEvent.createEvent(fault, token);
+				new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
+				return token;
+			}
+			
+			var ctype:String = contentType; 
+			var urlToUse:String = url; 
+			
+			if (urlToUse && urlToUse != '')
+			{
+				urlToUse = URLUtil.getFullURL(rootURL, urlToUse);
+			}
+			
+			if (filter != null)
+			{
+				// TODO: does this need to run on the array version of the parameters
+				ctype = filter.getRequestContentType(this, parameters, ctype);
+				urlToUse = filter.serializeURL(this, parameters, urlToUse);
+				parameters = filter.serializeBody(this, parameters);
+			}
+			
+			if (ctype == CONTENT_TYPE_XML)
+			{/*
+				if (parameters is String && xmlEncode == null)
+				{
+				paramsToSend = parameters as String;
+				}
+				else if (!(parameters is XMLNode) && !(parameters is XML))
+				{
+				if (xmlEncode != null)
+				{
+				var funcEncoded:Object = xmlEncode(parameters);
+				if (null == funcEncoded)
+				{
+				token = new AsyncToken(null);
+				msg = resourceManager.getString(
+				"rpc", "xmlEncodeReturnNull");
+				fault = new Fault(ERROR_ENCODING, msg);
+				faultEvent = FaultEvent.createEvent(fault, token);
+				new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
+				return token;
+				}
+				else if (!(funcEncoded is XMLNode))
+				{
+				token = new AsyncToken(null);
+				msg = resourceManager.getString(
+				"rpc", "xmlEncodeReturnNoXMLNode");
+				fault = new Fault(ERROR_ENCODING, msg);
+				faultEvent = FaultEvent.createEvent(fault, token);
+				new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
+				return token;
+				}
+				else
+				{
+				paramsToSend = XMLNode(funcEncoded).toString();
+				}
+				}
+				else
+				{
+				var encoder:SimpleXMLEncoder = new SimpleXMLEncoder(null);                    
+				var xmlDoc:XMLDocument = new XMLDocument();
+				
+				//right now there is a wasted <encoded> wrapper tag
+				//call.appendChild(encoder.encodeValue(parameters));
+				var childNodes:Array = encoder.encodeValue(parameters, new QName(null, "encoded"), new XMLNode(1, "top")).childNodes.concat();                    
+				for (var i:int = 0; i < childNodes.length; ++i)
+				xmlDoc.appendChild(childNodes[i]);
+				
+				paramsToSend = xmlDoc.toString();
+				}
+				}
+				else
+				{
+				paramsToSend = XML(parameters).toXMLString();
+				}*/
+			}
+			else if (ctype == CONTENT_TYPE_FORM)
+			{
+				paramsToSend = {};
+				var val:Object;
+				
+				if (typeof(parameters) == "object")
+				{
+					//get all dynamic and all concrete properties from the parameters object
+					var classinfo:Object = ObjectUtil.getClassInfo(parameters);
+					
+					for each (var p:* in classinfo.properties)
+					{
+						val = parameters[p];
+						if (val != null)
+						{
+							if (val is Array)
+								paramsToSend[p] = val;
+							else
+								paramsToSend[p] = val.toString();
+						}
+					}
+				}
+				else
+				{
+					paramsToSend = parameters;
+				}
+			}
+			else
+			{
+				paramsToSend = parameters;
+			}
+			
+			var message:HTTPRequestMessage = new HTTPRequestMessage();
+			if (useProxy)
+			{
+				if (urlToUse && urlToUse != '')
+				{
+					message.url = urlToUse;
+				}
+				
+				if (NetworkMonitor.isMonitoring())
+				{
+					//trace(" HTTPService: Recording Headers (useProxy = true)");
+					message.recordHeaders = true;    
+				}
+			}
+			else
+			{
+				if (!urlToUse)
+				{
+					token = new AsyncToken(null);
+					msg = resourceManager.getString("rpc", "urlNotSpecified");
+					fault = new Fault(ERROR_URL_REQUIRED, msg);
+					faultEvent = FaultEvent.createEvent(fault, token);
+					new AsyncDispatcher(dispatchRpcEvent, [faultEvent], 10);
+					return token;
+				}
+				
+				if (!useProxy)
+				{
+					var dcs:ChannelSet = getDirectChannelSet();
+					if (dcs != asyncRequest.channelSet)
+						asyncRequest.channelSet = dcs;
+				}
+				
+				if (NetworkMonitor.isMonitoring())
+				{
+					//trace(" HTTPService: Recording Headers (useProxy = false)");
+					message.recordHeaders = true;    
+				}
+				
+				message.url = urlToUse;
+			}
+			
+			message.contentType = ctype;
+			message.method = method.toUpperCase();
+			if (ctype == CONTENT_TYPE_XML && message.method == HTTPRequestMessage.GET_METHOD)
+				message.method = HTTPRequestMessage.POST_METHOD;
+			message.body = paramsToSend;
+			message.httpHeaders = getHeaders();
+			return invoke(message);
+		}
+		
+		/**
+		 *  Returns the HTTP request headers.
+		 *  Subclasses can override this method to control 
+		 *  the retrieval of the HTTP request headers. 
+		 *
+		 *  @return The HTTP request headers.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		protected function getHeaders():Object
+		{
+			return headers;
+		}
+		
+		/**
+		 *  @private
+		 */
+		override mx_internal function processResult(message:IMessage, token:AsyncToken):Boolean
+		{
+			var body:Object = message.body;
+			
+			_log.info("Decoding HTTPService response");
+			_log.debug("Processing HTTPService response message:\n{0}", message);
+			
+			var filter:SerializationFilter = getSerializationFilter();
+			
+			if (filter != null)
+				body = filter.deserializeResult(this, body);
+			
+			if ((body == null) || ((body != null) && (body is String) && (StringUtil.trim(String(body)) == "")))
+			{
+				_result = body;
+				return true;
+			}
+			else if (body is String)
+			{
+				if (/*resultFormat == RESULT_FORMAT_XML || */resultFormat == RESULT_FORMAT_OBJECT 
+					|| resultFormat == RESULT_FORMAT_ARRAY)
+				{/*
+					//old XML style
+					var tmp:Object = new XMLDocument();
+					XMLDocument(tmp).ignoreWhite = true;
+					try
+					{
+					XMLDocument(tmp).parseXML(String(body));
+					}
+					catch(parseError:Error)
+					{
+					var fault:Fault = new Fault(ERROR_DECODING, parseError.message);
+					dispatchRpcEvent(FaultEvent.createEvent(fault, token, message));
+					return false;
+					}
+					if (resultFormat == RESULT_FORMAT_OBJECT || resultFormat == RESULT_FORMAT_ARRAY)
+					{
+					var decoded:Object;
+					var msg:String;
+					if (xmlDecode != null)
+					{
+					decoded = xmlDecode(tmp);
+					if (decoded == null)
+					{
+					msg = resourceManager.getString(
+					"rpc", "xmlDecodeReturnNull");
+					var fault1:Fault = new Fault(ERROR_DECODING, msg);
+					dispatchRpcEvent(FaultEvent.createEvent(fault1, token, message));
+					}
+					}
+					else
+					{
+					var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(makeObjectsBindable);
+					
+					decoded = decoder.decodeXML(XMLNode(tmp));
+					
+					if (decoded == null)
+					{
+					msg = resourceManager.getString(
+					"rpc", "defaultDecoderFailed");
+					var fault2:Fault = new Fault(ERROR_DECODING, msg);
+					dispatchRpcEvent(FaultEvent.createEvent(fault2, token, message));
+					}
+					}
+					
+					if (decoded == null)
+					{
+					return false;
+					}
+					
+					if (makeObjectsBindable && (getQualifiedClassName(decoded) == "Object"))
+					{
+					decoded = new ObjectProxy(decoded);
+					}
+					else
+					{
+					decoded = decoded;
+					}
+					
+					if (resultFormat == RESULT_FORMAT_ARRAY)
+					{
+					decoded = decodeArray(decoded);
+					}
+					
+					_result = decoded;
+					}
+					else
+					{
+					if (tmp.childNodes.length == 1)
+					{
+					tmp = tmp.firstChild;
+					}
+					_result = tmp;
+					}*/
+				}
+				else if (resultFormat == RESULT_FORMAT_E4X)
+				{
+					try
+					{
+						_result = new XML(String(body));
+					}
+					catch(error:Error)
+					{
+						var fault3:Fault = new Fault(ERROR_DECODING, error.message);
+						dispatchRpcEvent(FaultEvent.createEvent(fault3, token, message));
+						return false;
+					}
+				}
+				else if (resultFormat == RESULT_FORMAT_FLASHVARS)
+				{
+					_result = decodeParameterString(String(body));
+				}
+				else //if only we could assert(theService.resultFormat == "text")
+				{
+					_result = body;
+				}
+			}
+			else
+			{
+				if (resultFormat == RESULT_FORMAT_ARRAY)
+				{
+					body = decodeArray(body);
+				}
+				
+				_result = body;
+			}
+			
+			return true;
+		}
+		
+		override mx_internal function invoke(message:IMessage, token:AsyncToken = null):AsyncToken
+		{
+			if (showBusyCursor)
+			{
+				// CursorManager.setBusyCursor();
+			}
+			
+			return super.invoke(message, token);
+		}
+		
+		/*
+		* Kill the busy cursor, find the matching call object and pass it back
+		*/
+		override mx_internal function preHandle(event:MessageEvent):AsyncToken
+		{
+			if (showBusyCursor)
+			{
+				// CursorManager.removeBusyCursor();
+			}
+			
+			var wasLastCall:Boolean = activeCalls.wasLastCall(AsyncMessage(event.message).correlationId);
+			var token:AsyncToken = super.preHandle(event);
+			
+			if (Concurrency.LAST == concurrency && !wasLastCall)
+			{
+				return null;
+			}
+			//else
+			return token;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		// Private Methods
+		// 
+		//--------------------------------------------------------------------------    
+		
+		private function decodeArray(o:Object):Object
+		{
+			var a:Array;
+			
+			if (o is Array)
+			{
+				a = o as Array;
+			}
+			else if (o is ArrayCollection)
+			{
+				return o;
+			}
+			else
+			{
+				a = [];
+				a.push(o);
+			}
+			
+			if (makeObjectsBindable)
+			{
+				return new ArrayCollection(a);
+			}
+			else
+			{
+				return a;            
+			}
+		}
+		
+		private function decodeParameterString(source:String):Object
+		{
+			var trimmed:String = StringUtil.trim(source);
+			var params:Array = trimmed.split('&');
+			var decoded:Object = {};
+			for (var i:int = 0; i < params.length; i++)
+			{
+				var param:String = params[i];
+				var equalsIndex:int = param.indexOf('=');
+				if (equalsIndex != -1)
+				{
+					var name:String = param.substr(0, equalsIndex);
+					name = name.split('+').join(' ');
+					name = unescape(name);
+					var value:String = param.substr(equalsIndex + 1);
+					value = value.split('+').join(' ');
+					value = unescape(value);
+					decoded[name] = value;
+				}
+			}
+			return decoded;
+		}
+		
+		private function getDirectChannelSet():ChannelSet
+		{
+			if (_directChannelSet == null)
+			{
+				var dcs:ChannelSet = new ChannelSet();
+				var dhc:DirectHTTPChannel = new DirectHTTPChannel("direct_http_channel");
+				dhc.requestTimeout = requestTimeout;
+				dcs.addChannel(dhc);
+				_directChannelSet = dcs;            
+			}
+			return _directChannelSet;  
+		}
+		
+		mx_internal var _log:ILogger;
+		
+		mx_internal var resourceManager:IResourceManager =
+			ResourceManager.getInstance();
+		/** 
+		 *  @private
+		 *  A shared direct Http channelset used for service instances that do not use the proxy. 
+		 */
+		private static var _directChannelSet:ChannelSet;
+		
+		private var _concurrency:String;
+		
+		private var _method:String = HTTPRequestMessage.GET_METHOD;
+		
+		private var _showBusyCursor:Boolean = false;
+		
+	}
+	
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPMultiService.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPMultiService.as
new file mode 100644
index 000000000..4705c0cbc
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPMultiService.as
@@ -0,0 +1,539 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.rpc.http
+{
+
+import mx.core.mx_internal;
+import mx.logging.ILogger;
+import mx.logging.Log;
+import mx.messaging.ChannelSet;
+import mx.messaging.channels.DirectHTTPChannel;
+import mx.messaging.config.LoaderConfig;
+import mx.messaging.messages.HTTPRequestMessage;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.rpc.AbstractService;
+import mx.rpc.events.FaultEvent;
+import mx.rpc.mxml.Concurrency;
+import mx.utils.URLUtil;
+
+import mx.messaging.errors.ArgumentError;
+
+use namespace mx_internal;
+
+/**
+ *  Dispatched when an HTTPMultiService call returns successfully.
+ * @eventType mx.rpc.events.ResultEvent.RESULT 
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="result", type="mx.rpc.events.ResultEvent")]
+
+/**
+ *  Dispatched when an HTTPMultiService call fails.
+ * @eventType mx.rpc.events.FaultEvent.FAULT 
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="fault", type="mx.rpc.events.FaultEvent")]
+
+/**
+ *  The invoke event is fired when an HTTPMultiService call is invoked so long as
+ *  an Error is not thrown before the Channel attempts to send the message.
+ * @eventType mx.rpc.events.InvokeEvent.INVOKE 
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="invoke", type="mx.rpc.events.InvokeEvent")]
+
+[ResourceBundle("rpc")]
+
+[DefaultProperty("operationList")]
+/**
+ *  You use the <code>&lt;mx:HTTPMultiService&gt;</code> tag to represent a
+ *  collection of http operations.  Each one has a URL, method, parameters and
+ *  return type.  
+ *
+ *  <p>You can set attributes such as the URL and method on the
+ *  HTTPMultiService tag to act as defaults for values set on each individual
+ *  operation tag.  The URL of the HTTPMultiService serves as the base url (meaning the prefix)
+ *  for any relative urls set on the http operation tags.
+ *  Each http operation has a <code>send()</code> method, which makes an HTTP request to the
+ *  specified URL, and an HTTP response is returned. </p>
+ *
+ *  <p>You can pass parameters to the specified URL which are used to put data into the HTTP request. 
+ *  The contentType property specifies a mime-type which is used to determine the over-the-wire
+ *  data format (such as HTTP form encoding or XML).  </p>
+ *
+ *  <p>You can also use a serialization filter to
+ *  implement a custom resultFormat such as JSON.   
+ *  When you do not go through the server-based
+ *  proxy service, you can use only HTTP GET or POST methods. However, when you set
+ *  the <code>useProxy </code> property to true and you use the server-based proxy service, you
+ *  can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods.</p>
+ *
+ *  <p><b>Note:</b> Unlike the HTTPService class, the HTTPMultiService class does not 
+ *  define a <code>request</code> property.</p>
+ *
+ *  <p><b>Note:</b> Due to a software limitation, like HTTPService, the HTTPMultiService does 
+ *  not generate user-friendly error messages when using GET and not using a proxy.</p>
+ * 
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ * 
+ *  @see mx.rpc.http.HTTPService
+ */
+public dynamic class HTTPMultiService extends AbstractService
+{
+    //--------------------------------------------------------------------------
+    //
+    // Constructor
+    // 
+    //--------------------------------------------------------------------------
+    
+    /**
+     *  Creates a new HTTPService. If you expect the service to send using relative URLs you may
+     *  wish to specify the <code>baseURL</code> that will be the basis for determining the full URL (one example
+     *  would be <code>Application.application.url</code>).
+     *
+     *  @param baseURL The URL the HTTPService should use when computing relative URLS.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function HTTPMultiService(baseURL:String = null, destination:String = null)
+    {
+        super();
+        
+        makeObjectsBindable = true;
+
+        if (destination == null)
+        {
+            if (URLUtil.isHttpsURL(LoaderConfig.url))
+                asyncRequest.destination = HTTPService.DEFAULT_DESTINATION_HTTPS;
+            else
+                asyncRequest.destination = HTTPService.DEFAULT_DESTINATION_HTTP;
+        }
+        else
+            asyncRequest.destination = destination;
+        
+        _log = Log.getLogger("mx.rpc.http.HTTPMultiService");
+
+        this.baseURL = baseURL;
+
+        concurrency = Concurrency.MULTIPLE;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    // 
+    //--------------------------------------------------------------------------
+    
+    /** 
+     *  @private
+     *  A shared direct Http channelset used for service instances that do not use the proxy. 
+     */
+    private static var _directChannelSet:ChannelSet;
+    
+    /**
+     *  @private
+     *  Logger
+     */
+    private var _log:ILogger;
+
+    /**
+     *  @private
+     */
+    private var resourceManager:IResourceManager = ResourceManager.getInstance();
+
+    /**
+     *  @private
+     */
+    private var _showBusyCursor:Boolean = false;
+
+    /**
+     *  @private
+     */
+    private var _concurrency:String;
+
+    //--------------------------------------------------------------------------
+    //
+    // Properties
+    // 
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  contentType
+    //----------------------------------
+
+    [Inspectable(enumeration="application/x-www-form-urlencoded,application/xml", defaultValue="application/x-www-form-urlencoded", category="General")]
+    /**
+     *  Type of content for service requests. 
+     *  The default is <code>application/x-www-form-urlencoded</code> which sends requests
+     *  like a normal HTTP POST with name-value pairs. <code>application/xml</code> send
+     *  requests as XML.
+     */
+    public var contentType:String = AbstractOperation.CONTENT_TYPE_FORM;
+
+    //----------------------------------
+    //  concurrency
+    //----------------------------------
+
+    [Inspectable(enumeration="multiple,single,last", defaultValue="multiple", category="General")]
+    /**
+     * Value that indicates how to handle multiple calls to the same operation within the service.
+     * The concurrency setting set here will be used for operations that do not specify concurrecny.
+     * Individual operations that have the concurrency setting set directly will ignore the value set here.
+     * The default value is <code>multiple</code>. The following values are permitted:
+     * <ul>
+     * <li><code>multiple</code> Existing requests are not cancelled, and the developer is
+     * responsible for ensuring the consistency of returned data by carefully
+     * managing the event stream. This is the default value.</li>
+     * <li><code>single</code> Only a single request at a time is allowed on the operation;
+     * multiple requests generate a fault.</li>
+     * <li><code>last</code> Making a request cancels any existing request.</li>
+     * </ul>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get concurrency():String
+    {
+        return _concurrency;
+    }
+    public function set concurrency(c:String):void
+    {
+        _concurrency = c;
+    }
+
+    //----------------------------------
+    //  showBusyCursor
+    //----------------------------------
+
+    [Inspectable(defaultValue="false", category="General")]
+    /**
+    * If <code>true</code>, a busy cursor is displayed while a service is executing. The default
+    * value is <code>false</code>.
+    *  
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
+    */
+    public function get showBusyCursor():Boolean
+    {
+        return _showBusyCursor;
+    }
+
+    public function set showBusyCursor(sbc:Boolean):void
+    {
+        _showBusyCursor = sbc;
+    }
+
+    //----------------------------------
+    //  headers
+    //----------------------------------
+
+    [Inspectable(defaultValue="undefined", category="General")]
+    /**
+     *  Custom HTTP headers to be sent to the third party endpoint. If multiple headers need to
+     *  be sent with the same name the value should be specified as an Array.  These headers are sent
+     *  to all operations.  You can also set headers at the operation level.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var headers:Object = {};
+
+    //----------------------------------
+    //  makeObjectsBindable
+    //----------------------------------
+
+    [Inspectable(defaultValue="true", category="General")]
+    /**
+     *  When <code>true</code>, the objects returned support data binding to UI controls.
+     *  That means  they send PropertyChangeEvents when their property values are being changed.  
+     *  This is the default value for any operations whose makeObjectsBindable property 
+     *  is not set explicitly.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var makeObjectsBindable:Boolean = true;
+
+    //----------------------------------
+    //  method
+    //----------------------------------
+
+    [Inspectable(enumeration="GET,get,POST,post,HEAD,head,OPTIONS,options,PUT,put,TRACE,trace,DELETE,delete", defaultValue="GET", category="General")]
+    /**
+     *  HTTP method for sending the request if a method is not set explicit on the operation. 
+     *  Permitted values are <code>GET</code>, <code>POST</code>, <code>HEAD</code>,
+     *  <code>OPTIONS</code>, <code>PUT</code>, <code>TRACE</code> and <code>DELETE</code>.
+     *  Lowercase letters are converted to uppercase letters. The default value is <code>GET</code>.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var method:String = HTTPRequestMessage.GET_METHOD;
+
+    //----------------------------------
+    //  resultFormat
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _resultFormat:String = AbstractOperation.RESULT_FORMAT_OBJECT;
+
+    [Inspectable(enumeration="object,array,xml,flashvars,text,e4x", defaultValue="object", category="General")]
+    /**
+     *  Value that indicates how you want to deserialize the result
+     *  returned by the HTTP call. The value for this is based on the following:
+     *  <ul>
+     *  <li>Whether you are returning XML or name/value pairs.</li>
+     *  <li>How you want to access the results; you can access results as an object,
+     *    text, or XML.</li>
+     *  </ul>
+     * 
+     *  <p>The default value is <code>object</code>. The following values are permitted:</p>
+     *  <ul>
+     *  <li><code>object</code> The value returned is XML and is parsed as a tree of ActionScript
+     *    objects. This is the default.</li>
+     *  <li><code>array</code> The value returned is XML and is parsed as a tree of ActionScript
+     *    objects however if the top level object is not an Array, a new Array is created and the result
+     *    set as the first item. If makeObjectsBindable is true then the Array 
+     *    will be wrapped in an ArrayCollection.</li>
+     *  <li><code>xml</code> The value returned is XML and is returned as literal XML in an
+     *    ActionScript XMLnode object.</li>
+     *  <li><code>flashvars</code> The value returned is text containing 
+     *    name=value pairs separated by ampersands, which
+     *  is parsed into an ActionScript object.</li>
+     *  <li><code>text</code> The value returned is text, and is left raw.</li>
+     *  <li><code>e4x</code> The value returned is XML and is returned as literal XML 
+     *    in an ActionScript XML object, which can be accessed using ECMAScript for 
+     *    XML (E4X) expressions.</li>
+     *  </ul>
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get resultFormat():String
+    {
+        return _resultFormat;
+    }
+
+    /**
+     *  @private
+     */
+    public function set resultFormat(value:String):void
+    {
+        switch (value)
+        {
+            case AbstractOperation.RESULT_FORMAT_OBJECT:
+            case AbstractOperation.RESULT_FORMAT_ARRAY:
+            //case AbstractOperation.RESULT_FORMAT_XML:
+            case AbstractOperation.RESULT_FORMAT_E4X:
+            case AbstractOperation.RESULT_FORMAT_TEXT:
+            case AbstractOperation.RESULT_FORMAT_FLASHVARS:
+            {
+                break;
+            }
+
+            default:
+            {
+                if (value != null && (serializationFilter = SerializationFilter.filterForResultFormatTable[value]) == null)
+                {
+                    var message:String = resourceManager.getString(
+                        "rpc", "invalidResultFormat",
+                        [ value, AbstractOperation.RESULT_FORMAT_OBJECT, AbstractOperation.RESULT_FORMAT_ARRAY,
+                          /*AbstractOperation.RESULT_FORMAT_XML,*/ AbstractOperation.RESULT_FORMAT_E4X,
+                          AbstractOperation.RESULT_FORMAT_TEXT, AbstractOperation.RESULT_FORMAT_FLASHVARS ]);
+                    throw new ArgumentError(message);
+                }
+            }
+        }
+        _resultFormat = value;
+    }
+
+    /** Default serializationFilter used by all operations which do not set one explicitly */
+    public var serializationFilter:SerializationFilter;
+
+    //----------------------------------
+    //  rootURL
+    //----------------------------------
+
+    /**
+     *  The URL that the HTTPService object should use when computing relative URLs.
+     *  This contains a prefix which is prepended onto any URLs when it is set.
+     *  It defaults to null in which case the URL for the SWF is used to compute
+     *  relative URLs.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var baseURL:String;
+    
+    /**
+     *  @private
+     */
+    override public function set destination(value:String):void
+    {
+        useProxy = true;
+        super.destination = value;
+    }
+
+    /**
+     *  @private
+     */
+    private var _useProxy:Boolean = false;
+    
+    [Inspectable(defaultValue="false", category="General")]
+    /**
+     *  Specifies whether to use the Flex proxy service. The default value is <code>false</code>. If you
+     *  do not specify <code>true</code> to proxy requests though the Flex server, you must ensure that the player 
+     *  can reach the target URL. You also cannot use destinations defined in the services-config.xml file if the
+     *  <code>useProxy</code> property is set to <code>false</code>.
+     *
+     *  @default false    
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get useProxy():Boolean
+    {
+        return _useProxy;
+    }
+
+    /**
+     *  @private
+     */
+    public function set useProxy(value:Boolean):void
+    {
+        if (value != _useProxy)
+        {
+            _useProxy = value;
+            var dcs:ChannelSet = getDirectChannelSet();
+            if (!useProxy)
+            {
+                if (dcs != asyncRequest.channelSet)
+                    asyncRequest.channelSet = dcs;
+            }
+            else
+            {
+                if (asyncRequest.channelSet == dcs)
+                    asyncRequest.channelSet = null;
+            }
+        }
+    }
+
+    /**
+     * This serves as the default property for this instance so that we can
+     * define a set of operations as direct children of the HTTPMultiService
+     * tag in MXML.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function set operationList(ol:Array):void
+    {
+        if (ol == null)
+            operations = null;
+        else
+        {
+            var op:AbstractOperation;
+            var ops:Object = {};
+            for (var i:int = 0; i < ol.length; i++)
+            {
+                op = AbstractOperation(ol[i]);
+                var name:String = op.name;
+                if (!name)
+                    throw new ArgumentError("Operations must have a name property value for HTTPMultiService");
+                ops[name] = op;
+            }
+            operations = ops;
+        }
+    }
+
+    public function get operationList():Array
+    {
+        // Note: does not preserve order of the elements
+        if (operations == null)
+            return null;
+        var ol:Array = [];
+        for (var i:String in operations)
+        {
+            var op:AbstractOperation = operations[i];
+            ol.push(op);
+        }
+        return ol;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Internal Methods
+    // 
+    //--------------------------------------------------------------------------
+
+    mx_internal function getDirectChannelSet():ChannelSet
+    {
+        if (_directChannelSet == null)
+        {
+            var dcs:ChannelSet = new ChannelSet();
+            var dhc:DirectHTTPChannel = new DirectHTTPChannel("direct_http_channel");
+            dhc.requestTimeout = requestTimeout;
+            dcs.addChannel(dhc);
+            _directChannelSet = dcs;            
+        }
+        return _directChannelSet;  
+    }
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as
index fb17a8fc0..dbabec580 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as
@@ -124,6 +124,25 @@ public class HTTPService extends EventDispatcher
     // 
     //--------------------------------------------------------------------------
       
+	/**
+	 *  Indicates that the HTTPService object uses the DefaultHTTP destination.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static const DEFAULT_DESTINATION_HTTP:String = "DefaultHTTP";
+	
+	/**
+	 *  Indicates that the HTTPService object uses the DefaultHTTPS destination.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static const DEFAULT_DESTINATION_HTTPS:String = "DefaultHTTPS";
 
     /**
      * @private
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as
new file mode 100644
index 000000000..15d8ab972
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPServiceWrapper.as
@@ -0,0 +1,11 @@
+package mx.rpc.http
+{
+	// Ref : https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/com/adobe/fiber/services/wrapper/HTTPServiceWrapper.html#methodSummary
+	public class HTTPServiceWrapper extends HTTPMultiService
+	{
+		
+		public var _serviceControl:mx.rpc.http.HTTPMultiService;
+		
+		
+	}
+}
\ No newline at end of file
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/SerializationFilter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/SerializationFilter.as
new file mode 100644
index 000000000..2a25a93d1
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/SerializationFilter.as
@@ -0,0 +1,231 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.rpc.http 
+{
+
+import mx.core.mx_internal;
+import mx.messaging.errors.ArgumentError;
+
+use namespace mx_internal;
+
+/**
+ * This class is useful for framework developers wishing to plug in or modify the
+ * HTTP services to use a new serialization format.  This allows you to invoke
+ * methods on the service object and control how parameters are mapped to a specific
+ * serialiation format such as XML, JSON, etc.  The SerializationFilter mechanism
+ * allows you to add a new resultFormat as well.
+ * 
+ * <p> An instance of this class can manage formatting HTTP requests, responses, and
+ * converting their parameters.  When you use HTTPService or HTTPMultiService, you 
+ * are usually talking to a server which expects the data to be provided in a specific
+ * format - for example, URL encoded values for a type HTML form, XML values or another
+ * serialization format such as JSON.  SerializationFilter 
+ * allows you to customize how HTTPService and HTTPMultiService convert an operation's
+ * parameters into the body of the HTTP request and how the response is converted into
+ * the return value of the operation.  Framework developers can introduce a new serialization
+ * format to the system by providing a new implementation of the SerializationFilter and
+ * use these components and all of the frameworks and tools built on these components
+ * without having to know the details of the format itself. </p>
+ * 
+ * <p>The first thing you do is to extend the SerializationFilter and override one or more
+ * of the conversion methods.   The filter allows you to turn the ordered list of parameters
+ * into a request body, modify the request body, modify the content type used in the
+ * request, modify the actual URL used in the request, and convert the response data into
+ * the result object returned in the result event of the service.</p>
+ * 
+ * <p>There are two ways to specify the SerializationFilter for a particular HTTPService,
+ * or HTTPMultiService.  You can either set the serializationFilter property on the service
+ * or you can statically register a SerializationFilter for a new result format.  If you
+ * use this approach, simply by specifying the resultFormat you can use a pre-registered
+ * SerializationFilter.  So for example, you might register a SerializationFilter for the
+ * "json" type and can then use that filter by setting resultFormat="json".</p>
+ *
+ * <p>
+ * Note that HTTPService only provides methods which directly take the request body
+ * and so does not use the "serializeParameters" method.
+ * </p>
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class SerializationFilter
+{
+    // replaces/returns previous with that name or null
+    static mx_internal var filterForResultFormatTable:Object = {};
+
+    /**
+     * This static function is used to register a new SerializationFilter for a 
+     * particular resultFormat value.  If you call this method once at startup,
+     * you can then just specify the resultFormat property of an HTTPService or HTTPMultiService
+     * to use that serialization filter to make it easier for developers to specify a
+     * format.
+     *
+     * @param resultFormat A custom resultFormat name to be associated with the supplied
+     * SerializationFilter.  
+     * @param filter The SerializationFilter to register.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static function registerFilterForResultFormat(resultFormat:String, filter:SerializationFilter):SerializationFilter
+    {
+        var old:SerializationFilter = filterForResultFormatTable[resultFormat];
+        filterForResultFormatTable[resultFormat] = filter;
+        return old;
+    }
+
+
+    /**
+     * This method takes the result from the HTTP request in a raw format.  It 
+     * can convert it to a more fully typed ActionScript object if desired.  
+     * To make the SerializationFilter more general, you can use the resultType or 
+     * resultElementType properties of the AbstractOperation provided so your code can 
+     * dynamically map the incoming request to the type configured in ActionScript as
+     * the return type.
+     * <p>
+     * Note also that AbstractOperation has a "properties" map which you
+     * can use to store additional properties as part of the service invocation
+     * in ActionScript to handle the deserialization of a particular type.
+     * </p>
+     * 
+     * @param operation The AbstractOperation which is being invoked.  
+     * @param result the raw result as returned from the server.  
+     * @return the converted result which will then be supplied in the result event
+     * for the service.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function deserializeResult(operation:AbstractOperation, result:Object):Object
+    {
+        return result;
+    }
+
+    /**
+     * This method is called by the HTTP service just before a call is made.  Its role
+     * is to choose the contentType used for this request.  For many serialization
+     * formats, there is a single fixed content type so you might just return that content
+     * type here.  Since the HTTPService is itself configured with a content type, that
+     * value is passed in here and returned by the default implementation.  The request
+     * body being serialized is also provided with the obj parameter just in case the 
+     * content type depends on the type of object being sent to the server.
+     *
+     * @param operation The AbstractionOperation being invoked.
+     * @param obj the body of the HTTP request being serialized
+     * @param contentType the contentType configured for the operation
+     * @return the content type to use for this HTTP request.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getRequestContentType(operation:AbstractOperation, obj:Object, contentType:String):String
+    {
+        return contentType;
+    }
+
+    /**
+     * This method is called from the "send" method of the HTTP service invocation to convert the
+     * parameters into a request body.  The parameters of the original send call are put into the
+     * params array.  This method converts this set of parameters into to a single object which is used as the 
+     * data for the HTTP request body.  The default implementation produces an object where the 
+     * keys are the values in the Operation's argumentNames array and the values are the values of the parameters.
+     * When using the default implementation, you must set argumentNames to have the same number
+     * of elements as the parameters array.
+     * 
+     * <p>Note that this method is not used if you invoke the HTTP operation using the sendBody
+     * method which just takes a single object.  In that case, this step is skipped and only
+     * the serializeBody method is called.</p>
+     *
+     * @param operation The AbstractOperation being invoked.
+     * @param params the list of parameters passed to the send method
+     * @return the body to be used in the HTTP request
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function serializeParameters(operation:AbstractOperation, params:Array):Object
+    {
+        var argNames:Array = operation.argumentNames;
+
+        if (params == null || params.length == 0)
+            return params;
+
+        if (argNames == null || params.length != argNames.length)
+            throw new ArgumentError("HTTPMultiService operation called with " + (argNames == null ? 0 : argNames.length) + " argumentNames and " + params.length + " number of parameters.  When argumentNames is specified, it must match the number of arguments passed to the invocation");
+
+        var obj:Object = new Object();
+        for (var i:int = 0; i < argNames.length; i++)
+            obj[argNames[i]] = params[i];
+
+        return obj;
+    }
+
+    /**
+     * This method is called for all invocations of the HTTP service.  It is able to convert
+     * the supplied object into a form suitable for placing directly in the HTTP's request
+     * body.  The default implementation just returns the object passed in as the body without
+     * any conversion.
+     *
+     * @param operation The AbstractOperation being invoked
+     * @param obj the initial body of the HTTP request, either the return value of serializeParameters or the parameter to the sendBody method
+     * or the send method of HTTPService.
+     * @return the potentially converted body to use in the request.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function serializeBody(operation:AbstractOperation, obj:Object):Object
+    {
+        return obj;
+    }
+
+    /**
+     * This method is used if you need to take data from the request body object and encode
+     * it into the URL string.  It is given the incoming URL as configured on the operation
+     * or service.  This implementation just returns the incoming URL without any conversion.
+     *
+     * @param operation The AbstractOperation being invoked
+     * @param url the URL set on the service or operation
+     * @return the potentially modified URL to use for this request.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function serializeURL(operation:AbstractOperation, obj:Object, url:String):String
+    {
+        return url;
+    }
+}
+
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services