I have a problem with consuming a third-party web service in .NET C#. It runs on Apache (NuSoap). Everything works normally up to deserialization (probably...). When I call the SoapHttpClientProtocol.Invoke()
function, I always get an object array with one null object. Bad is that this web service doesn't provide a WSDL document. :-(
Can anybody help me, please? I think, that the deserialization process doesn't run.
Here is soap response:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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/">
<SOAP-ENV:Body>
<ns1:EncodingTestResponse xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
<item xmlns:ns4071="http://xml.apache.org/xml-soap" xsi:type="ns4071:Map">
<item>
<key xsi:type="xsd:string">ascii</key>
<value xsi:type="xsd:string">ertzyuuioasdcnERSTZYUIOADCN</value>
</item>
<item>
<key xsi:type="xsd:string">latin2</key>
<value xsi:type="xsd:string">xy</value>
</item>
<item>
<key xsi:type="xsd:string">w1250</key>
<value xsi:type="xsd:string">pq</value>
</item>
</item>
</ns1:EncodingTestResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Calling method:
[SoapTrace]
[SoapDocumentMethod("EncodingTest",ParameterStyle=SoapParameterStyle.Wrapped)]
public item EncodingTest()
{
var obj = this.Invoke("EncodingTest", new object[] {});
return null;
}
and the object, which I was trying to deserialize:
[Serializable]
[XmlType(Namespace = "http://xml.apache.org/xml-soap", TypeName="item")]
public class item
{
[XmlArray("item", Form = XmlSchemaForm.Unqualified)]
public item[] items { get; set; }
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public string key { get; set; }
[XmlElement(Form = XmlSchemaForm.Unqualified)]
public string value { get; set; }
}