Hi friends - I have been wrestling with a problem that I was hoping
you could help me out with :)

I understand the premise of defining a WebService in Flex, with
parameters and data, and sending the data over the wire to my WSDL. 
However, I have a unique situation where I want to assemble a dynamic
XML file and send it over a WebService.  Unless you define a 1 to 1
mapping of parameters in Flex to a WSDL, I cant find any way to make
this work.

Example:  This works just fine as an operation on a webservice - 

<mx:operation name="SaveAction">
 <mx:request>
  <mx:myParameter>{someStringVariable}</mx:myParameter>
 </mx:request>
</mx:operation>

This is a 1 to 1 mapping of a parameter in Flex to my WSDL, which
expects 1 value called myParameter.

However, if I pass in an XML object, SOAP will change all of my < and
> to &lt; and &gt; to avoid breaking the SOAP envelope.  I understand
the need to do this, but I just cant find a way around it.

Example:

var myXMLObject:XML = "<tag1><tag2></tag1></tag2>"

<mx:operation name="SaveAction">
 <mx:request>
  <mx:myParameter>{myXMLObject}</mx:myParameter>
 </mx:request>
</mx:operation>

The resulting packet across the wire will be one
parameter(myparameter), with my XML as a string and all of the < and >
encoded to &gt...etc.  I have tried every hack I can think of and I
cant get this to work.  Has anyone else had experience using a
dynamically sized XML as the model for a webservice?

Any help is MUCH appreciated :)

Best Regards,

- - Dan

p.s. - I have come up with ways around this.. such as sending as an
HTTPService with contentType="application/xml".. or decoding the &gt,
&lt on the webservice side.  Both of those work, but neither of those
fit within the webservice standards we currently apply here.  Thanks
again.

Reply via email to