Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Web Service in C# : Invoke() function returns null
    text
    copied!<p>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 <code>SoapHttpClientProtocol.Invoke()</code> function, I always get an object array with one null object. Bad is that this web service doesn't provide a WSDL document. :-( </p> <p>Can anybody help me, please? I think, that the deserialization process doesn't run.</p> <p>Here is soap response:</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;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; &lt;SOAP-ENV:Body&gt; &lt;ns1:EncodingTestResponse xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;item xmlns:ns4071="http://xml.apache.org/xml-soap" xsi:type="ns4071:Map"&gt; &lt;item&gt; &lt;key xsi:type="xsd:string"&gt;ascii&lt;/key&gt; &lt;value xsi:type="xsd:string"&gt;ertzyuuioasdcnERSTZYUIOADCN&lt;/value&gt; &lt;/item&gt; &lt;item&gt; &lt;key xsi:type="xsd:string"&gt;latin2&lt;/key&gt; &lt;value xsi:type="xsd:string"&gt;xy&lt;/value&gt; &lt;/item&gt; &lt;item&gt; &lt;key xsi:type="xsd:string"&gt;w1250&lt;/key&gt; &lt;value xsi:type="xsd:string"&gt;pq&lt;/value&gt; &lt;/item&gt; &lt;/item&gt; &lt;/ns1:EncodingTestResponse&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>Calling method:</p> <pre><code>[SoapTrace] [SoapDocumentMethod("EncodingTest",ParameterStyle=SoapParameterStyle.Wrapped)] public item EncodingTest() { var obj = this.Invoke("EncodingTest", new object[] {}); return null; } </code></pre> <p>and the object, which I was trying to deserialize:</p> <pre><code>[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; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload