0 Replies Latest reply on Jan 15, 2010 8:21 AM by DBrummett

    Complex Types in Webservices

    DBrummett

      Hi,

       

      I'm trying to make a call to a web service method which takes a complex type as a parameter.

      I'm using an object of type Object and setting two properties of the object called name and body then passing the object as the parameter of the webservice method.  The problem that I'm seeing is that the name property doesn't seem to be getting set.  I'm using Wireshark to packet sniff the SOAP request Flex sends to the webservice and I never see the name property in the request (but I do see the body property every time).

       

      Please note that this is not a connectivity issue as I am able to successfully make several other methods which do not take parameters with complex types.

       

      Does anybody know what I need to do to get this name property to show up properly in the complex type?

       

      Here is my Flex code:

      </mx:Script>

      <![CDATA[

      public function init() : void {

           var mb : Object;

           mb = new Object();

           mb.name = "inputMsg";

           mb.body = "foo";

           service.setMessage.send(mb);

      }

      ]]>

      </mx:Script>

       

       

      <mx:WebService

        id="service"

        result="onResult(event)"

        fault="onFault(event)"

        wsdl="http://FOOBAR:8282/EngineService/engine?wsdl">

        </mx:WebService>

       

      Here is the SOAP request I picked up in Wireshark:

      O@8qE2@g@t@F#H"P0<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

          <ns0:setMessage xmlns:ns0="http://isws.pervasive.com">

            <mb xsi:type="intf:Message" xmlns:intf="http://isws.pervasive.com/">

              <body xsi:type="xsd:string">foo</body>

            </mb>

          </ns0:setMessage>

        </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

      Thanks,

      Dan