title: Accessing SOAP method through WSDL with port binding PHP
body: <p>I am currently trying to consume a SOAP web service using Zend SOAP Client, but I am currently facing the problem of not being able to get to any of the methods because the post binding location address is different to that of the url I am accessing the WSDL from.</p>
  
  <p>I have found this similar issue on SO already:</p>
  
  <p><a href="https://stackoverflow.com/questions/1439615/workaround-for-php-soap-request-failure-when-wsdl-defines-service-port-binding-a">Workaround for PHP SOAP request failure when wsdl defines service port binding as https and port 80?</a></p>
  
  <p>But the comment the OP asked here </p>
  
  <p><a href="https://stackoverflow.com/questions/1439615/workaround-for-php-soap-request-failure-when-wsdl-defines-service-port-binding-a#comment1286053_1439744">Workaround for PHP SOAP request failure when wsdl defines service port binding as https and port 80?</a> </p>
  
  <p>is what I am currently looking for a answer for.</p>
  
  <p>This is the error I currently get when I make the call to the WSDL</p>
  
  <pre><code>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxxx.xxx.xx:9076/inventory?wsdl=InventoryWSSoap.wsdl' : failed to load external entity "http://xxxx.xxx.xx:9076/inventory?wsdl=InventoryWSSoap.wsdl"
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;?php
  require_once "vendor/autoload.php";
  
  $apiUrl = "https://testurl.com/inventory?wsdl";
  
  try {
      $client = new Zend\Soap\Client($apiUrl, array(
          'compression' =&gt; SOAP_COMPRESSION_ACCEPT,
          'proxy_port' =&gt; 9076,
      ));
  
      $params = array(
          'name' =&gt; 'usnema',
          'pwd' =&gt; 'xxxxx',
          'operatorId' =&gt; '11210210'
      );
      $adSpace = $client-&gt;GetAdSpaceList($params);
  
      echo "&lt;pre&gt;";
      var_dump($adSpace);
  } catch (Exception $e) {
      echo $e-&gt;getMessage();
  }
  </code></pre>