0
我想产生一个SOAP头类似下面SOAP请求与PHP SoapClient的(嵌套头)
<SOAP-ENV:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
<Username>api_username</Username>
<Password>api_password</Password>
<Signature>api_signature</Signature>
<Subject>authorizing_account_emailaddress</Subject>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
参考:https://developer.paypal.com/webapps/developer/docs/classic/api/PayPalSOAPAPIArchitecture/
我尝试做以下事情产生这种结构,
$credentialsHeader = new SoapHeader("urn:ebay:apis:eBLBaseComponents", "Credentials",
array(
"Username : username.user.name",
"Password : password",
"Signature : signature",
"Subject : my_email_id"
));
$requesterCredential = new SoapHeader("urn:ebay:api:PayPalAPI", "RequesterCredentials", $credentialsHeader);
$client->__setSoapHeaders(array($requesterCredential));
但我得到一个错误:
{main}Authentication failed. API credentials are incorrect.
我假设我正在做错的方式,我正在形成标题?对此的一些见解或帮助将会很大。