Paypal sandbox endpoint webservice - Error "You do not have permissions to make this API call" - authentication

I used this paypal endpoint webservice for my PHP5 SoapClient :
Sandbox API Signature SOAP https://api-3t.sandbox.paypal.com/2.0/
And when i send my soap request with my credentials, i get an error with :
Ack => failure
ErrorCode => 10002
Short message => Authentication/Authorization failed
Long message => You do not have permissions to make this API call
This is current Soap message send to soap paypal API :
<?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>
I instantiated this PHP5 SoapClient :
//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);
But when I called SetExpressCheckout paypal soap service, i receive the following soap message :
<?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>
Nevertheless, I used the API credentials of my business account test...
I don't understand why my code doesnt work.
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) ?

Related

Consuming SOAP web service in SENCHA TOUCH?

I have found this post that worked for me but I recieved a HTML response instead of a XML one which is what I need for my app.
How to consume SOAP web service in SENCHA TOUCH?
This is my request to my server... I know I should be doing a POST action as this guy was told, but I still get a root node error.
Is this the proper way to consume a WebService, or there is another way to consume in Sencha using data models and stores? I have already saw an example using CFC but I am using IIS 7.5
POST /url/mobilews.asmx HTTP/1.1
Host: 10.0.1.182
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
Ext.Ajax.request({
method: 'GET',
url: 'http://url/mobileservice/mobilews.asmx?op=HelloWorld',
params: { method: 'HelloWorld', format: 'json' },
success: function (response, request) {
alert('Working!');
alert(response.responseText);
},
failure: function (response, request) {
alert('Not working!');
}
});
Here goes the error message:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Is there some example xml for the FormInfo list for the updateCredentialsForItem1?

I have been receiving the following error when trying to post updated login credentials:
<Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Can not invoke the getTypeObject method in the extension mapper class...
I am accessing the SOAP API via a rails app using the savon gem.
addItemForContentService is working with the same xsi:type definition, and I have used getLoginFormCredentialsForItem to retrieve FormInfos to push back into updateCredentialsForItem1, with no success.
If I could just get some sample xml (that works) for this call I would really appreciate it.
It seems like the parameters you are sending are incorrect or the WSDL format.
For your reference below is XML for updateCredentialsForItem1(you need to change values):
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateCredentialsForItem1 xmlns="http://itemmanagement.accountmanagement.core.soap.yodlee.com">
<userContext xmlns="">
<cobrandId>134131232</cobrandId>
<channelId>-1</channelId>
<locale>
<country>US</country>
<language>en</language>
<variant></variant>
</locale>
<tncVersion>2</tncVersion>
<applicationId>7A367HGJ621219F00</applicationId>
<cobrandConversationCredentials xsi:type="ns1:SessionCredentials" xmlns:ns1="http://login.ext.soap.yodlee.com">
<sessionToken>YOUR_COBRAND_CONVERSATION_TOKEN_VALUE</sessionToken>
</cobrandConversationCredentials>
<preferenceInfo>
<currencyCode>USD</currencyCode>
<timeZone>PST</timeZone>
<dateFormat>MM/dd/yyyy</dateFormat>
<currencyNotationType>SYMBOL_NOTATION</currencyNotationType>
<numberFormat>
<decimalSeparator>.</decimalSeparator>
<groupingSeparator>,</groupingSeparator>
<groupPattern>###,##0.##</groupPattern>
</numberFormat>
</preferenceInfo>
<fetchAllLocaleData>false</fetchAllLocaleData>
<conversationCredentials xsi:type="ns2:SessionCredentials" xmlns:ns2="http://login.ext.soap.yodlee.com">
<sessionToken>USER_CONVERSATION_TOKEN_VALUE</sessionToken>
</conversationCredentials>
<valid>true</valid>
<isPasswordExpired>false</isPasswordExpired>
</userContext>
<itemId xmlns="">1219123123</itemId>
<credentialFields xmlns="">
<elements xsi:type="ns3:SecureFieldInfoSingle" xmlns:ns3="http://common.soap.yodlee.com">
<name>LOGIN</name>
<displayName>Username</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>2212059</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_USERNAME</value>
<valueIdentifier>LOGIN</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>TEXT</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
<elements xsi:type="ns4:SecureFieldInfoSingle" xmlns:ns4="http://common.soap.yodlee.com">
<name>PASSWORD1</name>
<displayName>Password</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>22121258</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_PASSWORD_VALUE</value>
<valueIdentifier>PASSWORD1</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>PASSWORD</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
<elements xsi:type="ns5:FieldInfoSingle" xmlns:ns5="http://common.soap.yodlee.com">
<name></name>
<displayName>Verify Password</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>22121258</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_PASSWORD_VALUE</value>
<valueIdentifier>PASSWORD1</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>PASSWORD</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
</credentialFields>
<startRefreshItemOnUpdate xmlns="">false</startRefreshItemOnUpdate>
</updateCredentialsForItem1>
</soapenv:Body>
</soapenv:Envelope>

Apigee Pre-Flight Options Requests

I create api proxies and check the box that says "Enable Direct Browser Access for Your API — Allow direct requests from a browser via CORS." but my OPTIONS requests are still failing with :
{
"fault": {
"faultstring": "Received 405 Response without Allow Header",
"detail": {
"errorcode": "protocol.http.Response405WithoutAllowHeader"
}
}
}
From what I understand about CORS Pre-Flight Options requests, the client first sends the OPTIONS request to the server as a safeguard for "safe" CORS. This request should return a response with the list of request types that are available.
My Question: How do I make it so that Apigee responds correctly to OPTIONS requests and does not pass the OPTIONS request to my api behind the proxy?. If it helps I have AngularJS javascript apps trying to communicate with my Apigee endpoint.
Javascript errors:
OPTIONS http://api.example.com No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://client.example.com' is therefore not allowed access.
XMLHttpRequest cannot load http://api.example.com. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://client.example.com' is therefore not allowed access.
Default "Add CORS" xml
<AssignMessage async="false" continueOnError="false" enabled="true" name="Add-CORS">
<DisplayName>Add CORS</DisplayName>
<FaultRules/>
<Properties/>
<Add>
<Headers>
<Header name="Access-Control-Allow-Origin">*</Header>
<Header name="Access-Control-Allow-Headers">origin, x-requested-with, accept</Header>
<Header name="Access-Control-Max-Age">3628800</Header>
<Header name="Access-Control-Allow-Methods">GET, PUT, POST, DELETE</Header>
</Headers>
</Add>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
Default Proxy Endpoints xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Description/>
<Flows/>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<HTTPProxyConnection>
<BasePath>/v1/cnc</BasePath>
<VirtualHost>default</VirtualHost>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
</ProxyEndpoint>
Default Target Endpoint xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<Flows/>
<PreFlow name="PreFlow">
<Request/>
<Response>
<Step>
<Name>Add-CORS</Name>
</Step>
</Response>
</PreFlow>
<HTTPTargetConnection>
<URL>http://api.example.com/v1/assets.json</URL>
</HTTPTargetConnection>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
</TargetEndpoint>
Since you don't want the OPTIONS request to pass through to the backend API, there are two things needed:
A RouteRule to a null target with condition for the OPTIONS request. Notice there is no TargetEndpoint specified.
<RouteRule name="NoRoute">
<Condition>request.verb == "OPTIONS"</Condition>
</RouteRule>
A custom flow in the ProxyEndpoint to handle the CORS response. Since the new RouteRule sends the message to a null Target (echoes request back to client), the message will not route to the 'default' TargetEndpoint where the CORS policy currently is defined.
An updated version of your ProxyEndpoint would look like the below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Description/>
<Flows>
<Flow name="OptionsPreFlight">
<Request/>
<Response>
<Step>
<Name>Add-CORS</Name>
</Step>
</Response>
<Condition>request.verb == "OPTIONS"</Condition>
</Flow>
</Flows>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<HTTPProxyConnection>
<BasePath>/v1/cnc</BasePath>
<VirtualHost>default</VirtualHost>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="NoRoute">
<Condition>request.verb == "OPTIONS"</Condition>
</RouteRule>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
</ProxyEndpoint>
NOTE: The RouteRules are evaluated in the order specified in the ProxyEnpoint configuration. You should always have the default (no condition) Route at the end. Otherwise, if at the top, it will always match and never evaluate the other Route possibilities.
I did the same thing mentioned in the above answer but still getting the same issue. Then after doing some research issue was solved.
The issue was that the cors header response was not passed as header during request. To solve that you can do is adding the cors value in proxy endpoint preflow as well:
<PreFlow name="PreFlow">
<Request/>
<Response>
<Step>
<Name>Add-CORS</Name>
</Step>
</Response>
</PreFlow>

RoR: Error when connecting affilinet web services (logon function) using savon (ruby on rails) -> Deserialization Failed

I try to logon at the affilinet web services via the provided logon function. I'm working in a Rails 3 environment (3.0.x). I utilize the ruby on rails gem Savon in version 2 which in turn uses soap to connect to affilinet.
The most current wsdl can be found here https://api.affili.net/V2.0/Logon.svc?wsdl.
My code looks like this:
client = Savon.client do
wsdl "https://api.affili.net/V2.0/Logon.svc?wsdl"
end
message = {'Username' => 'username', 'Password' => 'password', 'WebServiceType' => 'Publisher'}
response = client.call(:logon, :message => message)
The request generated by Savon:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://affilinet.framework.webservices/Svc" xmlns:ins3="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ins2="http://affilinet.framework.webservices/types" xmlns:ins1="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF" xmlns:ins0="http://www.microsoft.com/practices/EnterpriseLibrary/2007/01/wcf/validation" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<tns:LogonRequestMsg>
<tns:Password>password</tns:Password>
<tns:WebServiceType>Publisher</tns:WebServiceType>
<tns:Username>username</tns:Username>
</tns:LogonRequestMsg>
</env:Body>
</env:Envelope>
When sending this request to the web service I get this (error) response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
<faultstring xml:lang="en-US">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://affilinet.framework.webservices/Svc:LogonRequestMsg. The InnerException message was 'Error in line 1 position 775. 'EndElement' 'LogonRequestMsg' from namespace 'http://affilinet.framework.webservices/Svc' is not expected. Expecting element 'Username | Password | WebServiceType'.'. Please see InnerException for more details.</faultstring>
<detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true"/>
<InnerException>
<HelpLink i:nil="true"/>
<InnerException i:nil="true"/>
<Message>Error in line 1 position 775. 'EndElement' 'LogonRequestMsg' from namespace 'http://affilinet.framework.webservices/Svc' is not expected. Expecting element 'Username | Password | WebServiceType'.</Message>
<StackTrace> at System.Runtime.Serialization.XmlObjectSerializerReadContext.ThrowRequiredMemberMissingException(XmlReaderDelegator xmlReader, Int32 memberIndex, Int32 requiredIndex, XmlDictionaryString[] memberNames)
 ... (loads more) ...
</StackTrace>
<Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Any ideas what's wrong?
EDIT:
The request in soapUI looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:svc="http://affilinet.framework.webservices/Svc" xmlns:typ="http://affilinet.framework.webservices/types">
<soapenv:Header/>
<soapenv:Body>
<svc:LogonRequestMsg>
<!--Optional:-->
<typ:Username>username</typ:Username>
<!--Optional:-->
<typ:Password>password</typ:Password>
<typ:WebServiceType>Publisher</typ:WebServiceType>
<!--Optional:-->
<typ:DeveloperSettings>
<!--Optional:-->
<typ:SandboxPublisherID>?</typ:SandboxPublisherID>
</typ:DeveloperSettings>
<!--Optional:-->
<typ:ApplicationSettings>
<!--Optional:-->
<typ:ApplicationID>?</typ:ApplicationID>
<!--Optional:-->
<typ:DeveloperID>?</typ:DeveloperID>
</typ:ApplicationSettings>
</svc:LogonRequestMsg>
</soapenv:Body>
</soapenv:Envelope>
Maybe the differences in the requests (generated by Savon and by soapUI) are the key!? Especially the different namespaces: svc/typ vs. env/tns. Any ideas? How can I tell Savon to use the svc namespace for the LogonRequestMsg?
Looking into the WSDL of Affili.net it shows that username, password, WebserviceType etc have the wrong namespace.
EDITED for the namespace after another look into your example. Username, Password and WebServiceType are defined in the namespace ins2="http://affilinet.framework.webservices/types" which is tagged by "ins2" in your case.
The quick and dirty way to get over it is
client = Savon.client do
wsdl "https://api.affili.net/V2.0/Logon.svc?wsdl"
end
message = {'ins2:Username' => 'username',
'ins2:Password' => 'password',
'ins2:WebServiceType' => 'Publisher'}
response = client.call(:logon, :message => message)
i think the problem is with namespace order, after several request saw different order in namespace.
This code works for me (savod version 1), overwrite namespaces:
message = {
'ins0:Username' => 'XXXXXXX',
'ins0:Password' => 'XXXXXXX',
'ins0:WebServiceType' => 'XXXXXX',
:order! => ['ins0:Username', 'ins0:Password', 'ins0:WebServiceType']
}
#client.wsdl.document = 'https://api.affili.net/V2.0/Logon.svc?wsdl'
response = #client.request :logon do
soap.body = message
soap.namespaces["xmlns:ins0"] = "http://affilinet.framework.webservices/types"
soap.namespaces["xmlns:ins1"] = "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
soap.namespaces["xmlns:ins2"] = "http://www.microsoft.com/practices/EnterpriseLibrary/2007/01/wcf/validation"
soap.namespaces["xmlns:ins3"] = "http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF"
end

PayPal API using SOAP

I need to use the PayPal API, using SOAP, to get our PayPal balance.
I've got as far as making a request using this XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
<Username>[xxxxx]</Username>
<Password>[xxxxx]</Password>
<Signature>[xxxxx]</Signature>
<Subject>
</Subject>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<GetBalanceReq xsi:type="GetBalanceRequest">
<GetBalanceRequest xsi:type="GetBalanceRequestType">
<Version>83.0</Version>
<ReturnAllCurrencies>0</ReturnAllCurrencies>
</GetBalanceRequest>
</GetBalanceReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
...but I'm getting this response:
SOAP-ENV:ClientMethod 'GetBalanceReq' not implemented
Does my XML look ok..?
You can omit the optional parts in the "Credentials" header. Maybe you did not select the right endpoint (it seems getBalance is not available). The following SOAP request works with the latest sandbox WSDL :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ebay:api:PayPalAPI" xmlns:urn1="urn:ebay:apis:eBLBaseComponents">
<soapenv:Header>
<urn:RequesterCredentials>
<urn1:Credentials>
<urn1:Username>xxxx</urn1:Username>
<urn1:Password>xxxx</urn1:Password>
<urn1:Signature>xxxx</urn1:Signature>
</urn1:Credentials>
</urn:RequesterCredentials>
</soapenv:Header>
<soapenv:Body>
<urn:GetBalanceReq>
<urn:GetBalanceRequest>
<urn1:Version>83.0</urn1:Version>
<urn:ReturnAllCurrencies>0</urn:ReturnAllCurrencies>
</urn:GetBalanceRequest>
</urn:GetBalanceReq>
</soapenv:Body>
</soapenv:Envelope>
And the response:
<SOAP-ENV:Envelope "...">
<SOAP-ENV:Header>
"..."
</SOAP-ENV:Header>
<SOAP-ENV:Body id="_0">
<GetBalanceResponse xmlns="urn:ebay:api:PayPalAPI">
<Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2011-10-20T17:27:54Z</Timestamp>
<Ack xmlns="urn:ebay:apis:eBLBaseComponents">Success</Ack>
<CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">e6bb1ac6861d7</CorrelationID>
<Version xmlns="urn:ebay:apis:eBLBaseComponents">83.0</Version>
<Build xmlns="urn:ebay:apis:eBLBaseComponents">2183220</Build>
<Balance xsi:type="cc:BasicAmountType" currencyID="USD">0.00</Balance>
<BalanceTimeStamp xsi:type="xs:dateTime">2011-10-20T17:27:54Z</BalanceTimeStamp>
</GetBalanceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>