Solved

call to db-server never returns

Posted on 2015-02-09
3
89 Views
Last Modified: 2015-03-30
Hi, have a Website with an iFrame PHP Programm. This program is getting data from IBM-Navision Server. The call to the Navision Server ( i did not program this) tends to not come back if something is not correct in the call parameter (eg. data not in DB).
Here is the code:
      $ibm = new SoapClient($ibm);
      // call Navision
      $result = $ibm->request($params);
      // if the call hangs - we will never get control back
      return $result;
Is there a easy way to get control back after a few seconds?
0
Comment
Question by:Solenthaler
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 40598838
There are two approaches here.

1. Set the timeout in the SoapClient. This will control the CONNECTION timeout. This is -probably- not the issue if the hanging is due to bad parameters. You can see some examples of how to set different options for that "new SoapClient" line in the documentation here:

http://php.net/manual/en/soapclient.soapclient.php

The examples don't include an example of the timeout, but the documentation that lists the different options discusses how to implement the "connection_timeout" option.

2. If the connection is hanging due to bad parameters, it's more likely that you'll need to set the default socket timeout:
http://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 40697202
Is there a reason you gave me a "B" grade instead of an "A" grade? You never said anything in my response was wrong and it would be beneficial to others to know if my suggestion was incorrect or what the correct final answer was.
0
 

Author Comment

by:Solenthaler
ID: 40697236
Dear gr8gonzo, thanks anyway for your answer. I had no chance to test it because the people from the server where not willing to change anything in there setup. Now we have to live with this unconfortable situation. I could never verify your solution.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now