Page 1 of 1

Web Service calls from PHP using SOAP

Posted: 22 Feb 2012, 14:00
by GreyWolf
Right, so I have been trying to call a web service using php for the last 2 days.

So far I have managed to make it so that there are no exceptions, but I do get a fatal error because the execution time of 30 seconds was exceeded.

Here is my code:

Code: Select all

<?php
try {
	$client = new SoapClient(null, array('location' => 'http://localhost:8080/nuSoap/samples/kmq-4.php','uri' => '****')); 
	$result = $client->__soapCall('GetItemQuantityOnHand', array(new SoapParam('SB3510/BK', '001'))); 
	printf("Result = %s\n", $result); 
	} 
	catch (Exception $e) 
	{
    printf("Message = %s\n",$e->__toString());
	}


?>
Can you guys spot an error in my code (I masked out the uri on purpose), or do I need to call the guys responsible for the web service and ask them to sort out their service?

Re: Web Service calls from PHP using SOAP

Posted: 10 Mar 2012, 23:35
by ameaq
It all depends on how they configure their server, or servers I guess.You would need to be more specific about which server/servers you are trying to communicate with for anyone to help you. Popular ones limit external communication

Re: Web Service calls from PHP using SOAP

Posted: 12 Mar 2012, 09:27
by GreyWolf
ok, after 2 weeks of problem solving, I figured out that the web service was configured incorrectly.

My php was fine.