0 Replies Latest reply on Jul 25, 2006 1:39 PM by kibab

    Webservice won't send Arrays

    kibab
      I have a problem wherein if I send across an Array of any type, simple or compound, the array is correctly sent across to the web service.

      The WSDL/XSD for the relevant portion of the web service looks like the following:

      WSDL:
      quote:

      <message name="sendStrings">
      <part element="tns:sendStrings" name="parameters"></part>
      </message>
      ...
      <operation name="sendStrings">
      <input message="tns:sendStrings"></input>
      <output message="tns:sendStringsResponse"></output>
      </operation>
      ...
      <operation name="sendStrings">
      <soap:operation soapAction=""></soap:operation>
      <input>
      <soap:body use="literal"></soap:body>
      </input>
      <output>
      <soap:body use="literal"></soap:body>
      </output>
      </operation>



      XSD:
      quote:

      <xs:element xmlns:ns3=" http://server.webservices/" type="ns3:sendStrings" name="sendStrings"></xs:element>

      <xs:complexType name="sendStrings">
      <xs:sequence>
      <xs:element type="xs:string" minOccurs="0" name="arg0" maxOccurs="unbounded"></xs:element>
      </xs:sequence>
      </xs:complexType>

      <xs:element xmlns:ns4=" http://server.webservices/" type="ns4:sendStringsResponse" name="sendStringsResponse"></xs:element>

      <xs:complexType name="sendStringsResponse">
      <xs:sequence>
      <xs:element type="xs:string" minOccurs="0" name="return" maxOccurs="unbounded"></xs:element>
      </xs:sequence>
      </xs:complexType>



      My code looks like the following. These calls happen in different event handlers, but assume they are all synchronous for now:

      quote:

      ws = new mx.rpc.soap.WebService();
      ws.loadWSDL(" http://192.168.1.108:8080/webservice/sample?wsdl");
      ws.sendStrings(new Array("One","Two","Three"));



      At that point, the the following SOAP request is made:

      quote:

      <?xml version="1.0" encoding="utf-8"?>
      <SOAP-ENV:Envelope xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns0:sendStrings xmlns:ns0=" http://server.webservices/" /></SOAP-ENV:Body></SOAP-ENV:Envelope>



      And the response looks like:

      quote:

      <?xml version="1.0" ?>
      <soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:ns1=" http://server.webservices/">
      <soapenv:Header xmlns:wsa=" http://www.w3.org/2005/08/addressing/"> </soapenv:Header>
      <soapenv:Body> <ns1:sendStringsResponse></ns1:sendStringsResponse> </soapenv:Body>
      </soapenv:Envelope>



      According to Livedocs arrays are automatically supported. I tried doing the same thing with an ArrayCollection, but that didn't help either.

      This really looks like a bug to me, can anybody confirm or show me what I'm doing wrong?

      Thanks.

      --Kaleb