Solved

call to db-server never returns

Posted on 2015-02-09
3
88 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

728 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

9 Experts available now in Live!

Get 1:1 Help Now