error with SoapClient

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AndrewBliss
Forum Newbie
Posts: 7
Joined: Mon Oct 05, 2009 4:24 pm

error with SoapClient

Post by AndrewBliss »

Hello, I am having some trouble with SoapClient.

When I make a new object it takes forever and returns an error message.

[text]Parsing WSDL: Couldn't load from 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl' :
failed to load external entity "http://soap.amazon.com/schemas2/AmazonWebServices.wsdl"[/text]

I have tried searching for answers and haven't found anything. I have all the modules in php installed, I don't know if they are correctly configured.
I have soap, libxml, curl.

So I tried just to do a file_get_contents and that times out also saying HTTP request failed. I have the allow_url_fopen On.

This all works if I am just doing it all local. By the way I don't really know how all this works. Also I am using php 5.3.3 and ubuntu maverick.

It works on windows xamp and a mac in the same office. I can't get the SoapClient to work on my machine.

Oh and I also tried doing a CURL call and it pulled all the info correctly.

Thanks for any input
User avatar
Sofw_Arch_Dev
Forum Commoner
Posts: 60
Joined: Tue Mar 16, 2010 4:06 pm
Location: San Francisco, California, US

Re: error with SoapClient

Post by Sofw_Arch_Dev »

What parameters are you using to create the SoapClient?

I know you said that different machines in the office had no issues, but I've experienced offices where some machines connected to a different sub-net that were not behind a proxy. A proxy may be interfering with the connection you're trying to make. Just an idea.
AndrewBliss
Forum Newbie
Posts: 7
Joined: Mon Oct 05, 2009 4:24 pm

Re: error with SoapClient

Post by AndrewBliss »

I am not using any parameters for the SoapClient, just the URI. I don't know if I am behind a proxy or not, I will have to find out the network setup here. Thanks for the idea, I am also thinking it might be a network issue.
User avatar
Sofw_Arch_Dev
Forum Commoner
Posts: 60
Joined: Tue Mar 16, 2010 4:06 pm
Location: San Francisco, California, US

Re: error with SoapClient

Post by Sofw_Arch_Dev »

Sorry to hear that. Network issues are commonplace IMO. Anyhow I'd recommend instantiating the SoapClient with at least array( "trace" => true ) as the second parameter. This'll allow you to use __getLastRequest() and __getLastResponse(), which are integral to sorting out any issues once you get over this initial hurdle.
AndrewBliss
Forum Newbie
Posts: 7
Joined: Mon Oct 05, 2009 4:24 pm

Re: error with SoapClient

Post by AndrewBliss »

I have put in array('trace'=>1) as the second parameter. I have been asking around about the network and it worked before on a windows setup in the same room, on the same network. So now I have no idea whatsoever.
AndrewBliss
Forum Newbie
Posts: 7
Joined: Mon Oct 05, 2009 4:24 pm

Re: error with SoapClient

Post by AndrewBliss »

Does anyone have any ideas? Does ubuntu have a firewall? I can run a curl request and get the wsdl file, then put run it locally from SoapClient. Why wouldn't I be able to run it normally?
Post Reply