0 Replies Latest reply on May 19, 2010 7:40 AM by bdog703

    Flex generates wrong webservice request XML

    bdog703

      Hi,

       

      I have a java based web service and it seem to be working fine for most of my method calls except one of them. Here is my webservice wsdl snippet:

       

       

       

       

      <xs:element name="SaveMessageObj">

           <xs:complexType>

                <xs:sequence>

                     <xs:element maxOccurs="unbounded" name="emObjects" type="ns1:emObject"/>

                     <xs:element maxOccurs="unbounded" minOccurs="0" name="parentIds" nillable="true" type="xs:string"/>

                </xs:sequence>

           </xs:complexType>

      </xs:element>

       

      <xs:element name="SaveObject">

           <xs:complexType>

                <xs:sequence>

                     <xs:element maxOccurs="unbounded" ref="tns:SaveMessageObj"/>

                </xs:sequence>

           </xs:complexType>

      </xs:element>

       

       

      ...

       

      <wsdl:message name="SaveObject">

      <wsdl:part element="tns:SaveObject" name="SaveObjectRequest">

          </wsdl:part>

      </wsdl:message>

       

      <wsdl:operation name="SaveObject">

      <wsdl:input message="tns:SaveObject" name="SaveObject">

          </wsdl:input>

      <wsdl:output message="tns:SaveObjectResponse" name="SaveObjectResponse">

          </wsdl:output>

      <wsdl:fault message="tns:SaveObjectFault" name="SaveObjectFault">

          </wsdl:fault>

      </wsdl:operation>

       

      I created the web service client code using the data services wizard in Flash 4 builder. Here is my code to call the web service:

       

      _service = new EMServices();

       

      var req:SaveMessageObj = new SaveMessageObj();

      req.emObjects = new ArrayCollection([emObject]);

      if (parentId != null)

      {

      req.parentIds = new ArrayCollection([parentId]);

      }

      _service.SaveObject(new ArrayCollection([req]));

       

       

      When I make the call with the above code, the XML that gets send over the wire is as follows:

       

      <SOAP-ENV:Body>

      <tns:SaveObject  xmlns:tns="http://sample.com/digitalmedia/EMServices">

      <tns:SaveMessageObj>

      <emObjects/>

      <parentIds>[object SaveMessageObj]</parentIds>

      </tns:SaveMessageObj>

      </tns:SaveObject>

      </SOAP-ENV:Body>

       

      It looks as if the service could not generate the XML properly since the parentIds contains the whole object as "[object SaveMessageObj]". Any ideas what might be wrong here, it looks like a bug but I can't be sure. I'm not using Flex 4 SDK, I'm using 3.5 SDK for this specific project due to some client limitations.

       

      Thanks!