SOAP deserialisation

Hi,

Do you know how you can deserialize the SOAP message below I receive this message from a webservice.
I would be nice if I can use it in my proxy class.

Thank you.

< xml version="1.0" encoding="UTF-8" >
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:xs.wsdl"
xmlns:ns2="
http://xml.apache.org/xml-soap"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getDocumentGroupsResponse>
<getDocumentGroupsReturn SOAP-ENC:arrayType="ns2:Map[7]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">vch_name</key>
<value xsi:type="xsd:string">OKZ</value>
</item>
<item>
<key xsi:type="xsd:string">int_docgroupid</key>
<value xsi:type="xsd:string">37</value>
</item>
</item>
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">vch_name</key>
<value xsi:type="xsd:string">Arrangementen KVV Rotterdam</value>
</item>
<item>
<key xsi:type="xsd:string">int_docgroupid</key>
<value xsi:type="xsd:string">38</value>
</item>
</item>
</getDocumentGroupsReturn>
</ns1:getDocumentGroupsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



Answer this question

SOAP deserialisation

  • code jockey

    ok.... but using this wsdl, are you able to add a new web reference in Visual Studio

    I tried, and I could....


  • Sten G

    oh.... now I see your problem....

    I would try to create my custom Map class as defined in the SOAP message you sent (with key and value pairs) and then manually change the proxy so this method returns a Map[].... you will have to use the SoapType attrbiute to set the name of the serialized xml tag.

    Rgds

    Rodrigo


  • gorla

    hkrabben, can't you get the wsdl of this web service


  • Bastiaan Molsbeck

    - That's the problem as you can see is the type in the wsdl 'xsd:anytype'.

    < xml version="1.0" encoding="UTF-8" >
    <!--
     WSDL file generated by Zend Studio. 
      -->
    - <definitions name="xs.wsdl" targetNamespace="urn:xs.wsdl" xmlns:typens="urn:xs.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
    - <message name="getDocumentGroups">
      <part name="strUsername1" type="xsd:string" />
      </message>
    - <message name="getDocumentGroupsResponse">
      <part name="getDocumentGroupsReturn" type="xsd:anyType" />
      </message>
    - <portType name="XpertSelectServicePortType">
    - <operation name="getDocumentGroups">
      <documentation>public function getDocumentGroups</documentation>
      <input message="typens:getDocumentGroups" />
      <output message="typens:getDocumentGroupsResponse" />
      </operation>
    </portType>
    - <binding name="XpertSelectServiceBinding" type="typens:XpertSelectServicePortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <operation name="getDocumentGroups">
      <soap:operation soapAction="urn:XpertSelectServiceAction" />
    - <input>
      <soap:body namespace="urn:xs.wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    - <output>
      <soap:body namespace="urn:xs.wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
    - <service name="xs.wsdlService">
    - <port name="XpertSelectServicePort" binding="typens:XpertSelectServiceBinding">
      <soap:address location="server.php" />
      </port>
      </service>
      </definitions>
     

  • gmukherjee

    thanks, it will be a great help!!
  • Vista2007new

    That's not the problem, the communication between the client en service is good. But the function getDocumentGroups returns a special type and in my proxy class the function returns an object and then I get an exception.
  • SOAP deserialisation