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

    Flex generates wrong webservice request XML

    bdog703 Level 1



      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:element maxOccurs="unbounded" name="emObjects" type="ns1:emObject"/>

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





      <xs:element name="SaveObject">



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








      <wsdl:message name="SaveObject">

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




      <wsdl:operation name="SaveObject">

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


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


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




      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:



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



      <parentIds>[object SaveMessageObj]</parentIds>





      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.