$wsdl = "https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl";
$soap = new SoapClient($wsdl);
throws the error:
SOAP-ERROR: Parsing Schema: unexpected in sequence
Tried on PHP versions 5.3.4, 5.3.0
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.