Solved

call to db-server never returns

Posted on 2015-02-09
3
92 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 35

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 35

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

685 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