RE: Error Fetching http headers

We have an intranet with a page that retrieves sales orders from NetSuite for viewing by our customer service team. This page makes 5 SOAP calls to get all of the information of for the order. This includes the order details, notes, item tracking, etc.

We have one user that frequently gets a blank screen and, through some troubleshooting code, we can see that the requests are failing with the error “Error Fetching http headers”.  This started happening a few months ago with a different order import integration program that also uses SOAP calls and we able to mitigate that by re-instantiating the connection service just before the SOAP call as it seemed they were timing out. But that seems to not have helped with our intranet page.

Any ideas on what could be causing this or how to correct it?

Scot Beginner Asked on September 10, 2019 in SuiteTalk.
Add Comment
5 Answers

For anyone else running into this, adding the following SOAP Client headers seems to have corrected this issue…

//set the Headers of Soap Client.
$client = new SoapClient($wsdlUrl, array(
‘trace’ => true,
‘keep_alive’ => true,
‘connection_timeout’ => 5000,
‘cache_wsdl’ => WSDL_CACHE_NONE,
Beginner Answered on September 12, 2019.

Interesting – and a good find.

If that’s helping to prevent the issue, then it seems that your app was getting occasional timeouts when trying to get the WSDL from NetSuite. I suspect that increasing the timeout to 5,000 seconds is what is really helping.

You might want to cache the WSDL (by changing “WSDL_CACHE_NONE” to “WSDL_CACHE_DISK” for example). This will reduce the number of times that your app needs to fetch the WSDL from NS, which should improve performance a bit. Setting “trace” to false, and “keep_alive” to false, might also help.

I’m glad you found a way to resolve this.

on September 12, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.