title: Estes Freight Pickup Web Service Basic Authentication
body: <p>I am trying to create a test pickup request using Estes web services. This particular service requires Basic Authentication using my login credentials. However, I can't seem to figure out how to perform the authentication using PHP and SoapClient. I keep getting the following error:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Uncaught SoapFault exception: [soapenv:Client] [ISS.0088.9164] Access to WSDescriptor estesrtpickup.base.ws.provider.soapws:pickupRequestSSL denied.</p>
  </blockquote>
  
  <p>My last attempt I tried to pass the credentials into WSDL address, but to no avail. Like so:</p>
  
  <pre><code>$client_pickup = new SoapClient('https://USERNAME:PASSWORD@apitest.estes-express.com/tools/pickup/request/v1.0?wsdl');
  </code></pre>
  
  <p>Here is my current block of PHP code for the Pickup Webservice:</p>
  
  <pre><code>public static function estesFreightPickupRequest($option) {
  
      self::$ShipToCity = preg_replace("/[^a-zA-Z0-9\s]/", "", $option-&gt;ShipToCity);
      self::$ShipToStateProvinceCode = preg_replace("/[^a-zA-Z0-9\s]/", "", $option-&gt;ShipToStateProvinceCode);
      self::$ShipToPostalCode = (string)$option-&gt;ShipToPostalCode;
      self::$ShipToPostalCode = substr(trim(self::$ShipToPostalCode), 0, 5);
      self::$ShipToPostalCode = str_pad(self::$ShipToPostalCode, 5, "0", STR_PAD_LEFT);
      self::$ShipToAddressLine = preg_replace("/[^a-zA-Z0-9\s]/", "", $option-&gt;ShipToAddressLine);
  
      $Weight = $option-&gt;weight;
      $d = strtotime("tomorrow");
      $request_date =  date("Y-m-d", $d);
      $path_to_wsdl_pickup = "https://apitest.estes-express.com/tools/pickup/request/v1.0?wsdl";
  
      ini_set("soap.wsdl_cache_enabled", "0");
  
      $client_pickup = new SoapClient('https://USERNAME:PASSWORD@apitest.estes-express.com/tools/pickup/request/v1.0?wsdl');
  
      ini_set("soap.wsdl_cache_enabled", "0");
  
      $header_pickup = new SoapHeader('http://www.estes-express.com/tools/pickup');   
  
      $client_pickup-&gt;__setSoapHeaders($header_pickup);
      //Enter the body data for WSDL
       $request_pickup = array(
  
          'requestNumber' =&gt; date("Y-m-d"),
          'shipper' =&gt; array(
              'shipperName' =&gt; 'COMPANY NAME',
              'accountCode' =&gt; 'ACCOUNT CODE',
              'shipperAddress' =&gt; array(
                  'addressInfo' =&gt; array( 
                      'addressLine1' =&gt; '1620 TEST CT',
                      'city' =&gt; 'SOMETOWN',
                      'stateProvince' =&gt; 'MO',
                      'postalCode' =&gt; '65222',
                      'countryAbbrev' =&gt; 'US'
                  )
              )
          ),
          'requestAction' =&gt; 'LL',
          'pickupDate'=&gt; date("Y-m-d"),
          'pickupStartTime' =&gt; '1200',
          'pickupEndTime' =&gt; '1500',
          'totalPieces' =&gt; '1',
          'totalWeight' =&gt; '100',
          'totalHandlingUnits' =&gt; '1',
          'whoRequested' =&gt; 'S'
  
      );
  
      try {
  
          $response_pickup = $client_pickup-&gt;createPickupRequestWS($request_pickup);
  
          //Error log the request and response
  
          error_log($client-&gt;__getLastRequest());
          error_log($client-&gt;__getLastResponse());            
  
  
          //$rateReply = $response-&gt;quoteInfo-&gt;quote-&gt;pricing-&gt;totalPrice;
  
          //Get the response data
  
          $result_array = array();
          $result_array['totalPrice'] = $estes_total_rate_amount;
  
  
          return $result_array;
  
  
      } catch (SoapFault $exception) {
         error_log('ERROR LOG::' . $exception, $client);        
      }
  }
  </code></pre>