title: SOAP WSDL PHP client connecting to .Net Server
body: <p>I need to integrate a web service, and its being like to days, and the closest I get is the following, maybe some of you have more experience than me in this kind of web service.</p>
  
  <p>The XML request I need to generate is the following</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"         xmlns:v2="http://v2.services.cangooroo.net/" xmlns:can="Cangooroo.Webservice.V2"&gt;
  &lt;soapenv:Header/&gt;
  &lt;soapenv:Body&gt;
  &lt;v2:getCityData&gt;
  &lt;v2:credentialClient&gt;
  &lt;can:UserName&gt;?&lt;/can:UserName&gt;
  &lt;can:Password&gt;?&lt;/can:Password&gt;
  &lt;/v2:credentialClient&gt;
  &lt;v2:countryId&gt;US&lt;/v2:countryId&gt;
  &lt;/v2:getCities&gt;
  &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>My PHP code</p>
  
  <pre><code> $client = new SoapClient("http://v2.cangooroo.net/ws/2013/common_a.asmx?WSDL", array(
         "trace" =&gt; 1,
         "compression" =&gt; SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP,
     ));
      $login = array();
      $login[] = new SoapVar('*', XSD_STRING, null, null, 'UserName', 'Cangooroo.Webservice.V2' );
      $login[] = new SoapVar('*', XSD_STRING, null, null, 'Password', 'Cangooroo.Webservice.V2' );
      $rest = array();
      $rest[] = new SoapVar($login, SOAP_ENC_OBJECT, null, null, 'credentialClient' );
      $rest[] = new SoapVar('US', XSD_STRING, null, null, 'countryId');
  
      $options = array('location' =&gt; 'http://v2.cangooroo.net/ws/2013/common_a.asmx');
  
      try {
          $resp = $client-&gt;__soapCall('getCityData', $rest, $options);
  
          print_r($resp);
          echo "Request:&lt;pre&gt;" . htmlentities($client-&gt;__getLastRequest()) . "&lt;/pre&gt;";
      }catch (SoapFault $e){
          echo "REQUEST:&lt;pre&gt;" . htmlentities($client-&gt;__getLastRequest()) . "&lt;/pre&gt;";
          /*print_r($e);*/
  </code></pre>
  
  <p>The actual xml the PHP code above generates</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:ns1="Cangooroo.Webservice.V2" xmlns:ns2="http://ws_2013.services.cangooroo.net/"&gt;
  &lt;SOAP-ENV:Body&gt;
  &lt;ns2:getCityData&gt;
  &lt;ns1:UserName&gt;*&lt;/ns1:UserName&gt;
  &lt;ns1:Password&gt;*&lt;/ns1:Password&gt;
  &lt;/ns2:getCityData&gt;&lt;countryId&gt;US&lt;/countryId&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Iam not really sure if this is the best way to do it, but I tryed others, with __soapCall, 
  __doRequest, this last one I got the soapClient php core class extended (as a try) to connect, and nothing seems to work. Pls, I could use a little help here. Tks guys.</p>