Question

After 2-3 years of using Paypal API, SoapClient fails to load WSDL

Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl' : Start tag expected, '<' not found in .../paypal.php on line 52

WSDL file: https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl

It fails to parse wsdl on three different computers

Is it SoapClient fault? Or WSDL is invalid? How to fix it? Some validators says XML/WSDL is OK, some validators says is not ok...

Was it helpful?

Solution

I found the issue.

SoapClient fails to parse the wsdl file when HTTP response headers are incorrect.

Since today Paypal sends Content-Type: text/html for wsdl file in HTTP response so I just copied wsdl/xsd files to my server and everything is OK again...

EDIT: now (17 Apr) it looks like paypal is sending file using text/plain

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top