title: Where to put WSDL and how to reference for SoapClient
body: <p>I'm certain this is a dumb newbie question, but this is the first time I'm working with SOAP, so I guess I qualify.  I'm having a heck of a time trying to load a local WSDL file from within my PHP class.  I don't understand where it is looking for the file or how I can reference it locally.  I could put the absolute path using the full website url, but that seems like overkill and it would ONLY work on this site.  I'd prefer to reference the file using a relative path.</p>
  
  <p>I'm using PHP with a Magento store.  The class that handles communication with the SOAP server is <code>Namespace_Module_Model_Carrier_Fedex_Addressvalidation</code>, which is located at <code>app/code/local/Namespace/Module/Model/Carrier/Fedex/Addressvalidation.php</code>.  An instance of this class is instantiated using <code>Mage::getModel('shippingrates/carrier_fedex_addressvalidation')</code> from within the <code>Namespace_Module_Model_Carrier_Fedex</code> class.  The WSDL location is defined at the top of the address validation class:</p>
  
  <pre><code>protected $_wsdl = 'AddressValidationService_v2.wsdl';
  </code></pre>
  
  <p>Within the constructor of the model I initialize the SoapClient:</p>
  
  <pre><code>$this-&gt;_client = new SoapClient($this-&gt;_wsdl);
  $this-&gt;_client-&gt;__setLocation($this-&gt;getServiceLocation());//returns a remote URL for their test server
  </code></pre>
  
  <p>The file is located in the same directory as the <strong>Addressvalidation.php</strong> file, but I have also tried locating it in the same directory as the <strong>Fedex.php</strong> script as well as at <strong>app/code/local/</strong> but nothing works.  I have tried setting the WSDL variable to <strong>./AddressValidationService_v2.wsdl</strong> as well as various other options but I always get an exception like this:</p>
  
  <pre><code>Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from './AddressValidationService_v2.wsdl' : failed to load external entity
  </code></pre>
  
  <p>If someone can please help me understand the scope and where the SoapClient looks for the files I think I'll have a better understanding of where to put them and how to reference them.</p>