That would change the type of transmission and it will be received
differently on the server.  
 
Thanks,
 
Sam
 
 
 
  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, December 29, 2006 12:00 PM
To: [email protected]
Subject: RE: [flexcoders] Cannot send simple XML content to server with
HTTPService



Send the xml as a string value of name=value pair using the default
contentType..

Tracy

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Samuel R. Neff
Sent: Friday, December 29, 2006 10:09 AM
To: [email protected]
Subject: [flexcoders] Cannot send simple XML content to server with
HTTPService

 

It appears that HTTPService will not send XML to a server if it's simple
content. 

Here's an example. Both buttons should send an HTTP POST to the server with
XML. However, the "Send Simple" button sends an HTTP GET with no content
whereas the Send Complex" button works fine. This can be confirmed by
checking the .NET trace log or a HTTP proxy/monitor.

Is there any workaround other than ensuring all content is complex (which
means ensuring the server side ignores extra junk in the message) ?

Thanks,

Sam

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe. <http://www.adobe.com/2006/mxml>
com/2006/mxml" layout="absolute">

<mx:Script>
<![CDATA[

private function sendSimple():void {
service.request = <testing one="1" />;
service.send();
}

private function sendComplex():void {
service.request = <testing><one
/></testing>;
service.send();
}

]]>
</mx:Script>
<mx:HTTPService 
id="service"
url="http://localhost/ <http://localhost/test.aspx> test.aspx" 
contentType="application/xml" 
resultFormat="e4x" 
method="POST" />
<mx:VBox>
<mx:Button label="Send Simple" click="sendSimple();" />
<mx:Button label="Send Complex" click="sendComplex();" />
</mx:VBox>

</mx:Application>

Reply via email to