Nikster2014
Nikster2014

Reputation: 409

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://...' in Google App Engine PHP App

I am trying to connect to Amazon Web Services from my GAE account using a simple PHP script. However, the very first line is throwing an error:

$wsdlURI = 'http://www.webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl'; $soapClient = new SoapClient($wsdlURI);

I get this error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://.....'failed to load external entity

When I do a simple file_get_contents on the above URL, it works just fine. Only the SoapClient is not able to get the handle on the wsdl file....and ONLY GAE seems to have this problem. I tried the same code on another server and everything works fine.

Is there any setting in GAE that I am missing??

Upvotes: 1

Views: 2409

Answers (3)

Stuart Langley
Stuart Langley

Reputation: 7054

This is also related to the disabling of loading of loading of external entities by default, you will need to enable this to get this to work.

First, you must create a php.ini file containing this line:

google_app_engine.enable_functions = "libxml_disable_entity_loader"

Then you add the following before your call.

libxml_disable_entity_loader(false);

For SoapClient to work using sockets application also needs to have billing enabled.

Upvotes: 2

Bomberman
Bomberman

Reputation: 1

Check that you have the following extensions activated: php open ssl and php soap client.

Upvotes: 0

Amy U.
Amy U.

Reputation: 2237

This issue is likely related: https://code.google.com/p/googleappengine/issues/detail?id=9858 . Looks like SOAP needs sockets support, which is not yet part of the PHP runtime.

Upvotes: 0

Related Questions