Using SOAP with PHP5
Moderator: General Moderators
Using SOAP with PHP5
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
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
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.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);
?>Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\htdocs\test\testSoap.php on line 14
please try again withalso take a closer look at
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);
?>http://pharmatest01.safe-med.com:24088/safemed/ws wrote:<soap:address location="http://safe-med.com:4088/safemed/ws"/>
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.
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.
volka wrote:also take a closer look athttp://pharmatest01.safe-med.com:24088/safemed/ws wrote:<soap:address location="http://safe-med.com:4088/safemed/ws"/>