Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication Paypal sandbox endpoint webservice-错误“您没有进行此API调用的权限”_Authentication_Soap_Permissions_Paypal_Sandbox - Fatal编程技术网

Authentication Paypal sandbox endpoint webservice-错误“您没有进行此API调用的权限”

Authentication Paypal sandbox endpoint webservice-错误“您没有进行此API调用的权限”,authentication,soap,permissions,paypal,sandbox,Authentication,Soap,Permissions,Paypal,Sandbox,我将此paypal端点Web服务用于我的PHP5 SoapClient: Sandbox API Signature SOAP https://api-3t.sandbox.paypal.com/2.0/ //Endpoint $location = 'https://api-3t.sandbox.paypal.com/2.0/'; $uri = 'urn:ebay:api:PayPalAPI'; //SoapClient options $options = array('tra

我将此paypal端点Web服务用于我的PHP5 SoapClient:

Sandbox API Signature   SOAP    https://api-3t.sandbox.paypal.com/2.0/
//Endpoint
$location = 'https://api-3t.sandbox.paypal.com/2.0/';
$uri = 'urn:ebay:api:PayPalAPI';

//SoapClient options
$options = array('trace' => 1, 'exceptions' => 1, 'location'=>$location, 'uri'=>$uri);

//My Soap Client
$client =new SoapClient('https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl',$options);
当我发送带有凭据的soap请求时,我会收到以下错误:

确认=>失败 错误代码=>10002 短消息=>身份验证/授权失败 Long message=>您没有进行此API调用的权限 这是当前发送到Soap paypal API的Soap消息:

<?xml version="1.0" encoding="UTF-8"?>

<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">

<SOAP-ENV:Header>
<ns3:RequesterCredentials xsi:type="ns4:UserIdPasswordType">
        <Username>xxxxx</Username>
        <Password>xxxxx</Password>
        <Signature>xxxxx</Signature>
    </ns3:RequesterCredentials>
</SOAP-ENV:Header>

<SOAP-ENV:Body>
<ns3:SetExpressCheckoutReq>
    <ns3:SetExpressCheckoutRequest>

      <ns1:Version>84.0</ns1:Version>

              <ns1:SetExpressCheckoutRequestDetails 
               xsi:type="ns2:SetExpressCheckoutRequestDetailsType">

               <ReturnUrl>url_to_/success.paypal.php</ReturnUrl>
               <CancelUrl>url_to_/cancel.paypal.php</CancelUrl>
               <LocaleCode>US</LocaleCode>

              </ns1:SetExpressCheckoutRequestDetails>

    </ns3:SetExpressCheckoutRequest>
    </ns3:SetExpressCheckoutReq>
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>
但是,当我调用SetExpressCheckout paypal soap服务时,我收到以下soap消息:

<?xml version="1.0" encoding="UTF-8"?>
<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">

<SOAP-ENV:Header>
    <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext"
                      xsi:type="wsse:SecurityType"></Security>

    <RequesterCredentials xmlns="urn:ebay:api:PayPalAPI"
                                  xsi:type="ebl:CustomSecurityHeaderType">

        <Credentials xmlns="urn:ebay:apis:eBLBaseComponents"
                                 xsi:type="ebl:UserIdPasswordType">
                    </Credentials>
    </RequesterCredentials>

</SOAP-ENV:Header>

<SOAP-ENV:Body id="_0">

    <SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI">

       <Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">
               2012-01-13T12:09:01Z
           </Timestamp>

    <Ack xmlns="urn:ebay:apis:eBLBaseComponents">Failure</Ack>
    <CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">
                c8d551f118a1
            </CorrelationID>

    <Errors xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:ErrorType">

           <ShortMessage xsi:type="xs:string">
                           Authentication/Authorization Failed
                   </ShortMessage>

           <LongMessage xsi:type="xs:string">
                        You do not have permissions to make this API call
                   </LongMessage>

            <ErrorCode xsi:type="xs:token">10002</ErrorCode>
            <SeverityCode xmlns="urn:ebay:apis:eBLBaseComponents">
                          Error
                        </SeverityCode>
        </Errors>

        <Version xmlns="urn:ebay:apis:eBLBaseComponents">84.0</Version>
        <Build xmlns="urn:ebay:apis:eBLBaseComponents">2271164</Build>

    </SetExpressCheckoutResponse>
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>
尽管如此,我还是使用了我的商业帐户测试的API凭据。。。 我不明白为什么我的代码不起作用


错误是:“您没有进行此API调用的权限”,但这怎么可能呢?因为我使用了正确的端点服务沙盒?

消息似乎非常明显。。。您要么没有包含正确的凭据,要么不允许您执行API请求想要执行的任何操作。没有显示任何代码,这是你能得到的最好答案。我的帖子非常简短,因为我没有真正帖子的答案。只要去看看,你应该在这里发布代码,而不是开始一个单独的问题。@blue_diamond我有同样的问题,但我没有得到解决。你能告诉我解决方法吗?你是如何解决问题的,我尝试了很多。请回复。@Aniket抱歉,现在才迟到,但我没有这个代码。如果我的记忆很好,你只需要把凭证元素放在一个元素中。下面是贝宝API使用的XSD文件示例:。。。 ...