Solved

call to db-server never returns

Posted on 2015-02-09
3
100 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

689 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