开发者

PHP SOAP Client throwing error while loading WSDL from paypal

$wsdl = "https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl";
$soap = new SoapClient($wsdl);

thr开发者_开发知识库ows the error:

SOAP-ERROR: Parsing Schema: unexpected in sequence

Tried on PHP versions 5.3.4, 5.3.0


The problem is in https://www.paypalobjects.com/wsdl/eBLBaseComponents.xsd which is a dependency for https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl
To work around this issue, you can download the WSDL and its dependencies and fix eBLBaseComponents.xsd manually (remove the erroneous extra > on the fourth line from the bottom right after ).

1) Download the following 4 files to the same directory

https://www.paypal.com/wsdl/PayPalSvc.wsdl
https://www.paypal.com/wsdl/eBLBaseComponents.xsd
https://www.paypal.com/wsdl/CoreComponentTypes.xsd
https://www.paypal.com/wsdl/EnhancedDataTypes.xsd

2) Remove the erroneous extra ">" on the fourth line from the bottom for eBLBaseComponents.xsd.
3) Upload your changes to your own host, or store them locally depending on your application.
4) In your application, point to the new, fixed WSDL.


It seems Paypal accept only the authorized connect to this SOAP url.

The PayPal SOAP API service is protected to ensure that only authorized PayPal members use it.

You can read about it here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜