I am using PHP's SoapClient class to connect to paypal. I have a number of problems:
- The paramaters I pass to the soap call are
array('ReturnAllCurrencies'=>0, 'Version'=>'63.0')
but as you can see in the request below,63.0
is put in<param1>
whatever that is. I don't even see ReturnAllCurrencies in the request.
In this request I am performing a GetBalance
command:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:api:PayPalAPI" xmlns:ns2="urn:ebay:apis:eBLBaseComponents">
<SOAP-ENV:Header>
<ns1:RequesterCredentials>
<ns2:Credentials>
<ns2:Username>xxxx</ns2:Username>
<ns2:Password>xxx</ns2:Password>
<ns2:Signature>xxx</ns2:Signature>
</ns2:Credentials>
</ns1:RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:GetBalanceReq/>
<param1>63.0</param1>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I found the request above via SoapClient::__getLastRequest(). It doesn't exacly look like the example on the paypal website. What's with the GetBalanceReq
tag? Why does it have the *Req suffix?
2.When using the production server and wsdl files, I get a php error:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://www.paypal.com/wsdl/PayPalSvc.wsdl' : Start tag expected, '<' not found
Furthermore if I try to visit the production certificate url in FireFox (https://api.paypal.com/2.0/) I get a ssl_error_handshake_failure_alert
Am I supposed to download the wsdl file and point to a local version in the first argument of SoapClient::__construct or am I simple supposed to point to the paypal hosted copy? I originally assumed the latter, but now I'm not sure
I'm highly confused by all this SOAP stuff, please help
Thanks, Jonah