title: PHP soapClient for Paypal SetExpressCheckout Authentication Failure
body: <p>This is current Soap message send to soap paypal API :</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="urn:ebay:apis:eBLBaseComponents" 
  xmlns:ns2="ebl:SetExpressCheckoutRequestDetails" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:ns3="urn:ebay:api:PayPalAPI" 
  xmlns:ns4="ebl:UserIdPasswordType"&gt;
  
  &lt;SOAP-ENV:Header&gt;
  &lt;ns3:RequesterCredentials xsi:type="ns4:UserIdPasswordType"&gt;
          &lt;Username&gt;xxxxx&lt;/Username&gt;
          &lt;Password&gt;xxxxx&lt;/Password&gt;
          &lt;Signature&gt;xxxxx&lt;/Signature&gt;
      &lt;/ns3:RequesterCredentials&gt;
  &lt;/SOAP-ENV:Header&gt;
  
  &lt;SOAP-ENV:Body&gt;
  &lt;ns3:SetExpressCheckoutReq&gt;
      &lt;ns3:SetExpressCheckoutRequest&gt;
  
        &lt;ns1:Version&gt;84.0&lt;/ns1:Version&gt;
  
                &lt;ns1:SetExpressCheckoutRequestDetails 
                 xsi:type="ns2:SetExpressCheckoutRequestDetailsType"&gt;
  
                 &lt;ReturnUrl&gt;url_to_/success.paypal.php&lt;/ReturnUrl&gt;
                 &lt;CancelUrl&gt;url_to_/cancel.paypal.php&lt;/CancelUrl&gt;
                 &lt;LocaleCode&gt;US&lt;/LocaleCode&gt;
  
                &lt;/ns1:SetExpressCheckoutRequestDetails&gt;
  
      &lt;/ns3:SetExpressCheckoutRequest&gt;
      &lt;/ns3:SetExpressCheckoutReq&gt;
  &lt;/SOAP-ENV:Body&gt;
  
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>I instantiated this PHP5 SoapClient :</p>
  
  <pre><code>//Endpoint
  $location = 'https://api-3t.sandbox.paypal.com/2.0/';
  $uri = 'urn:ebay:api:PayPalAPI';
  
  //SoapClient options
  $options = array('trace' =&gt; 1, 'exceptions' =&gt; 1, 'location'=&gt;$location, 'uri'=&gt;$uri);
  
  //My Soap Client
  $client =new SoapClient('https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl',$options);
  </code></pre>
  
  <p>But when I called SetExpressCheckout paypal soap service, i receive the following soap message :</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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
  xmlns:cc="urn:ebay:apis:CoreComponentTypes" 
  xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" 
  xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" 
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
  xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" 
  xmlns:ed="urn:ebay:apis:EnhancedDataTypes" 
  xmlns:ebl="urn:ebay:apis:eBLBaseComponents" 
  xmlns:ns="urn:ebay:api:PayPalAPI"&gt;
  
  &lt;SOAP-ENV:Header&gt;
      &lt;Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext"
                        xsi:type="wsse:SecurityType"&gt;&lt;/Security&gt;
  
      &lt;RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"
                                    xsi:type="ebl:CustomSecurityHeaderType"&gt;
  
          &lt;Credentials xmlns="urn:ebay:apis:eBLBaseComponents"
                                   xsi:type="ebl:UserIdPasswordType"&gt;
                      &lt;/Credentials&gt;
      &lt;/RequesterCredentials&gt;
  
  &lt;/SOAP-ENV:Header&gt;
  
  &lt;SOAP-ENV:Body id="_0"&gt;
  
      &lt;SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI"&gt;
  
         &lt;Timestamp xmlns="urn:ebay:apis:eBLBaseComponents"&gt;
                 2012-01-13T12:09:01Z
             &lt;/Timestamp&gt;
  
      &lt;Ack xmlns="urn:ebay:apis:eBLBaseComponents"&gt;Failure&lt;/Ack&gt;
      &lt;CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents"&gt;
                  c8d551f118a1
              &lt;/CorrelationID&gt;
  
      &lt;Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType"&gt;
  
             &lt;ShortMessage xsi:type="xs:string"&gt;
                             Authentication/Authorization Failed
                     &lt;/ShortMessage&gt;
  
             &lt;LongMessage xsi:type="xs:string"&gt;
                          You do not have permissions to make this API call
                     &lt;/LongMessage&gt;
  
              &lt;ErrorCode xsi:type="xs:token"&gt;10002&lt;/ErrorCode&gt;
              &lt;SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents"&gt;
                            Error
                          &lt;/SeverityCode&gt;
          &lt;/Errors&gt;
  
          &lt;Version xmlns="urn:ebay:apis:eBLBaseComponents"&gt;84.0&lt;/Version&gt;
          &lt;Build xmlns="urn:ebay:apis:eBLBaseComponents"&gt;2271164&lt;/Build&gt;
  
      &lt;/SetExpressCheckoutResponse&gt;
  &lt;/SOAP-ENV:Body&gt;
  
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Nevertheless, I used the API credentials of my business account test...
  I don't understand why my code doesnt work.</p>
  
  <p>The error is : 'You do not have permissions to make this API call', but how it's possible? Because i use the correct endpoint service (sandbox) ?</p>
  
  <p>Someone can help me please?</p>