views:

316

answers:

1

Hi, i have big problem with deserialization of XML response from third-party webservice.

here is xml response

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 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" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
  <SOAP-ENV:Body>
    <ns1:CardsListResponse xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      <return xmlns:ns9402="http://xml.apache.org/xml-soap" xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns9402:Map[62]">
        <item xmlns:ns6162="http://xml.apache.org/xml-soap" xsi:type="ns6162:Map">
          <item>
            <key xsi:type="xsd:string">card</key>
            <value xsi:type="xsd:string">0000000000</value>
          </item>
          <item>
            <key xsi:type="xsd:string">service</key>
            <value xsi:type="xsd:string">0</value>
          </item>
        </item>
      </return>
    </ns1:CardsListResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

invoking method

[SoapDocumentMethod]
[SoapTrace]
public object[] CardsList(string login, string password)
{
object[] result = this.Invoke("CardsList", new object[] { LOGIN, PASSWORD });
return (object[])result;
}

the Invoke method allways returns null, so the problem is in deserialization. Have anyone idea how fix the deserialization process? How can i affect this or can i write my own deserialization method??

Thanks a lot!

A: 

How did you create the code you posted? Was this from an "Add Web Reference" command, or did you create that code by itself? I ask because this looks like a response from an RPC-style application.

John Saunders
i created it myself, because the service hasn't WSDL.
Jan Remunda
If it doesn't have a WSDL, then it's not a SOAP web service. You're stuck with guessing what the contract is between the client and service. Good luck.
John Saunders
WSDL only describes the service. I have only problem with deserialization..
Jan Remunda
WSDL describes the service completely. It provides the information necessary to serialize and deserialize. In any case, try [SoapRpcMethod]
John Saunders