Expand my Community achievements bar.

Sending XML Attributes to a Web Service

Avatar

Level 1
Can I send attributes by loading an object, and sending it by
the WebService object? I am sending XML values in Action Script to
a SOAP web service via these classes:



mx.rpc.soap.WebService and mx.rpc.soap.AbstractOperation



Everything is working fine, however the attributes are not
getting passed over. My question is: How do I send XML attribute
values via a WebService object?



Example:



<person>

<Name>Bob</name>

</person>



I can send that like this:



var person:Object = new Object();

person.name = "Bob";



However, what if I wanted to send this XML, with the
attribute:



<person city="Mayberry">

<name>Bob</name>

</person>

1 Reply

Avatar

Level 3
There is a limitation with this as mx.rpc.soap.Operation sees
XML as a special case from the <mx:request> syntax that
allows for binding to an xml model from the MXML interface for
WebService... as such it expects the entire operation XML that
would be pasted inside the SOAP BODY to be included here, not just
the message part values.



I'll log a bug for the next release to allow for this.