title: Parsing WSDL: Couldn't Bind to Service
body: <p>Presently, I am trying to interface with a SOAP-based camera system to tie into its action API so I can control when its lights come on programatically and so forth. However, when I use the code below, it's saying it cannot bind to the service and doesn't seem to be able to properly digest the WSDL file associated with the API, which can be found here:</p>
  
  <p><a href="http://www.axis.com/vapix/ws/action1/ActionService.wsdl" rel="nofollow">http://www.axis.com/vapix/ws/action1/ActionService.wsdl</a></p>
  
  <p>Is there something that's wrong with my code, or is this an issue with the WSDL file itself? Thank you very much in advance for the assistance! In advance, the error generating is the following, generated at the instantiation of the SoapClient object in the constructor:</p>
  
  <p>SOAP-ERROR: Parsing WSDL: Couldn't bind to service</p>
  
  <pre><code>&lt;?php
  /**
   * The purpose of this class is to act as a means to interface with a Vapix camera
   * using SOAP requests so that events may be broadcast to it.
   */
  
  $vapix = new Vapix("http://www.axis.com/vapix/ws/action1/ActionService.wsdl",
                     "&lt;http://camera.address.edu&gt;",
                     "&lt;username&gt;", "&lt;password&gt;");
  if ($vapix)
  {
      echo "Connection to VAPIX successful!\n";
  }
  else
  {
      echo "Connection to VAPIX unsuccessful!\n";
  }
  
  /**
   * The constructor takes in a WSDL address, the actual interfacing address of the
   * server we are connecting to, a username, and a password, and establishes the
   * SOAP client we need to interface with said address.
   *
   * @param   $wsdl       The WSDL specification for the service we are interacting with.
   * @param   $address    The actual server address we are interfacing with.
   * @param   $username   The username we need to access the server.
   * @param   $password   The password we need to access the server.
   *
   * @return              New Vapix object ready to interface with SOAP service.
   */
  class Vapix
  {
      // the soap client variable we will be using to store our Vapix connection
      private $soapClient;
  
      public function __construct($wsdl, $address, $username, $password)
      {
          try
          {
              $soapClient = new SoapClient($wsdl, array("soap_version" =&gt; SOAP_1_2));
          }
          catch (SoapFault $fault)
          {
              echo "Error instantiating SOAP object!\n";
              echo $fault-&gt;getMessage() . "\n";
          }
  
          // prepare SOAP headers
          $sh_param = array(
              "username" =&gt; $username,
              "password" =&gt; $password
          );
  
          $headers = new SoapHeader($address, "UserCredentials", $sh_param);
  
  
          // prepare SOAP client
          $soapClient-&gt;__setSoapHeaders(array($headers));
      }
  
      /**
       * This function is a generalized function used for calling a SOAP request to
       * whatever service or server we are linked up to (in this case a VAPIX camera)
       * so that other more specialized functions can derive from it. It will take in
       * the name of the function, as well as a list of parameters.
       *
       * @param   $funcName   The name of the function we want to call.
       * @param   $parameters The parameters for the function we want to call.
       *
       * @return  $info       Returns info from the call if successful, NULL otherwise.
       */
      public function callSoapFunction($funcName, $parameters)
      {
          try 
          { 
              $info = $soapClient-&gt;__call($funcName, array($parameters)); 
          } 
          catch (SoapFault $fault) 
          {   
              print( 
                  "alert('Sorry, blah returned the following ERROR: " . $fault-&gt;faultcode . "-" .
                      $fault-&gt;faultstring.". We will now take you back to our home page.'); 
                  window.location = 'main.php';"
              ); 
  
              return NULL;
          }
  
          if ($error == 0) 
          {        
              return $info;
          }
      }
  }
  ?&gt;
  </code></pre>