Page 1 of 1
Using SOAP with PHP5
Posted: Sun Sep 30, 2007 5:40 am
by hsharma12
Hi All,
I am trying to access to a WSDL library using PHP5 soap extension. I am able to connect to the SOAP server and able to get the list of all the wsdl functions from the soap server. this means that I am successfully able to connect to the server however when I try to get access to the acrual library function using soapclient object, program takes forever and script halts after 30 mins.
Error that i get is as listed below.
Fatal error: Maximum execution time of 30 seconds exceeded in D:\wamp\www\test\testsoap.php on line 12
Any help or suggestions are highly appreciated.
Thanks,
Hariom
Posted: Sun Sep 30, 2007 7:57 am
by feyd
Post your code.
Posted: Sun Sep 30, 2007 11:42 pm
by hsharma12
feyd wrote:Post your code.
Code: Select all
<?
$client = new SoapClient(
"http://pharmatest01.safe-med.com:24088/safemed/ws");
echo "<br>Answer here";
print_r($client->__getFunctions()); // Able to print all the functions from the wsdl
$result = $client->regimenRouteList(); // Script hangs forever here.
?>
Here is my code.. Thanks for your interest.
Posted: Mon Oct 01, 2007 1:14 am
by jeffery
function "regimenRouteList" requires a parameter of type regimenRouteList
Posted: Mon Oct 01, 2007 1:45 am
by hsharma12
Code: Select all
<?
$client = new SoapClient(
"http://pharmatest01.safe-med.com:24088/safemed/ws");
//print_r($client->__getFunctions());
//echo "<br>Types here";
//print_r($client->__getTypes());
$params = array(
'description' => 'lipitor',
'threshold' => 500,
'flags' => 1
);
$result = $client->dispensableMedListByDescription($params);
?>
I have changed the function call to a new function with the required parameter passed. But still it has the same output.
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\htdocs\test\testSoap.php on line 14
Posted: Mon Oct 01, 2007 2:49 am
by volka
please try again with
Code: Select all
<?php
ini_set('default_socket_timeout', 5);
$client = new SoapClient("http://pharmatest01.safe-med.com:24088/safemed/ws", array('connection_timeout'=>5.0));
$params = array(
'description' => 'lipitor',
'threshold' => 500,
'flags' => 1
);
$result = $client->dispensableMedListByDescription($params);
?>
also take a closer look at
Posted: Mon Oct 01, 2007 3:35 am
by hsharma12
Thanks Volka for your reply.
I tried with your suggestions but this time I got a fatal error as mentioned below.
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in C:\Program Files\Apache Group\Apache2\htdocs\test\testSoap.php:13 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', '
http://safe-med...', 'dispensableMedL...', 1, 0) #1 [internal function]: SoapClient->__call('dispensableMedL...', Array) #2 C:\Program Files\Apache Group\Apache2\htdocs\test\testSoap.php(13): SoapClient->dispensableMedListByDescription(Array) #3 {main} thrown in C:\Program Files\Apache Group\Apache2\htdocs\test\testSoap.php on line 13
Please review and suggest accordingly.
Once again thanks to all the guys putting efforts for me.
Posted: Mon Oct 01, 2007 3:46 am
by volka
volka wrote:also take a closer look at
Posted: Mon Oct 01, 2007 3:48 am
by hsharma12
Volka,
This wsdl URL is fine. I had a look on that. Also I would like to mention that this URL works fine when I try to connect with this using CURL. I am not sure why is this creating the problem with PHP5.
Also, we can change the port no 8088 if you want to check.
Thanks
Posted: Mon Oct 01, 2007 4:06 am
by volka
4088
24088
sure?
Posted: Mon Oct 01, 2007 4:57 am
by hsharma12
Yes..its sure. This URL works fine if you put this directly in the address bar of the browser. It will list out the complete wsdl in front of you.

Posted: Mon Oct 01, 2007 5:32 am
by volka
Yes, it returns the wsdl if you connect to 24088. But the wsdl informs the client to connect to the port 4088. That's 24088 minus 20000.
Are you sure sure sure that is correct? I think it is not.
Posted: Mon Oct 01, 2007 6:07 am
by jeffery
hsharma12, as Volka suggested the end-point for the Webservice is unreachable. double check with the Webservice provider.
Posted: Mon Oct 01, 2007 6:27 am
by hsharma12
Volga, Oh..Thats definately not correct. It needs to connect to 24088 only..But why does it minus 2000 from that?
I also used 8088 (Web service provider also provides info on this port) but it does not work.
PLease suggest.
Posted: Mon Oct 01, 2007 9:12 am
by volka
But why does it minus 2000 from that?
It says so in the wsdl file