title: SOAP: PHP WebService and .Net
body: <p>I have to connect with PHP WebService via SOAP from a .Net (C#, WPF) application. I added reference to this service, some proxies were generated.</p>
  
  <p>When I invoked some function:</p>
  
  <pre><code>var client = new someAPIPortTypeClient();
  XmlNode[] response = client.status(arg1, arg2);    
  </code></pre>
  
  <p>I got response:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:nakopitel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt;
     &lt;SOAP-ENV:Body&gt;
        &lt;ns1:statusResponse&gt;
           &lt;statusReturn xsi:type="ns2:Map"&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;is_active&lt;/key&gt;
                 &lt;value xsi:type="xsd:boolean"&gt;true&lt;/value&gt;
              &lt;/item&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;allow_add_paid&lt;/key&gt;
                 &lt;value xsi:type="xsd:boolean"&gt;false&lt;/value&gt;
              &lt;/item&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;allow_search_free&lt;/key&gt;
                 &lt;value xsi:type="xsd:boolean"&gt;true&lt;/value&gt;
              &lt;/item&gt;
              &lt;item&gt;
                 &lt;key xsi:type="xsd:string"&gt;allow_add_free&lt;/key&gt;
                 &lt;value xsi:type="xsd:boolean"&gt;true&lt;/value&gt;
              &lt;/item&gt;
           &lt;/statusReturn&gt;
        &lt;/ns1:statusResponse&gt;
     &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>It interpreted like <code>XmlNode[]</code>...</p>
  
  <p>How can I get normal proxy-classes to work with this SOAP-service? I can ask the service author to change something if it requires.</p>
  
  <p>Update. WSDL for status function.</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  
  &lt;definitions name="something" targetNamespace="urn:something" xmlns:typens="urn:something" 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/"&gt;
    &lt;message name="status"&gt;
      &lt;part name="terminal" type="xsd:integer"/&gt;
      &lt;part name="code" type="xsd:string"/&gt;
    &lt;/message&gt;
    &lt;message name="statusResponse"&gt;
      &lt;part name="statusReturn" type="xsd:anyType"/&gt;
    &lt;/message&gt;
    &lt;portType name="someAPIPortType"&gt;
      &lt;operation name="status"&gt;
        &lt;documentation&gt;
          Get status
        &lt;/documentation&gt;
        &lt;input message="typens:status"/&gt;
        &lt;output message="typens:statusResponse"/&gt;
      &lt;/operation&gt;
      &lt;/portType&gt;
      &lt;binding name="someAPIBinding" type="typens:someAPIPortType"&gt;
      &lt;operation name="status"&gt;
        &lt;soap:operation soapAction="urn:someAPIAction"/&gt;
        &lt;input&gt;
          &lt;soap:body namespace="urn:something" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
        &lt;/input&gt;
        &lt;output&gt;
          &lt;soap:body namespace="urn:something" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
        &lt;/output&gt;
      &lt;/operation&gt;
      &lt;/binding&gt;
    &lt;service name="somethingService"&gt;
      &lt;port name="someAPIPort" binding="typens:someAPIBinding"&gt;
        &lt;soap:address location="http://something/soap/"/&gt;
      &lt;/port&gt;
    &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>