Ошибка error fetching http headers

I’m trying to invoke a WS over https on a remote host:remote port and I get:

Error fetching http headers

using the PHP5 SoapClient; I can get the list of functions by doing $client->__getFunctions() but when I call $client->myFunction(...) I always get this error.

I’ve googled and found that increasing default_socket_timeout in php.ini should fix it, but it did not work.

Can anyone suggest me a solution?

EDIT: here is the code:

$wsdl="myWSDL";

$client = new SoapClient($wsdl,array('connection_timeout'=>5,'trace'=>true,'soap_version'=>SOAP_1_2));

var_dump($client->__getFunctions());

try {
    $response=$client->myFunction("1","2","3");
         } catch (SoapFault $fault) {
    var_dump($fault);
    }
}

always ends in the error.

How do I solve the problem?

Emma's user avatar

Emma

27.3k11 gold badges43 silver badges69 bronze badges

asked Feb 22, 2012 at 21:39

Cris's user avatar

5

This error is often seen when the default_socket_timeout value is exceeded for the SOAP response. (See this link.)

Note from the SoapClient constructor: the connection_timeout option is used for defining a timeout value for connecting to the service, not for the timeout for its response.

You can increase it like so:

ini_set('default_socket_timeout', 600); // or whatever new value you want

This should tell you if the timeout is the issue, or whether you have a different problem. Bear in mind that you should not use this as a permanent solution, but rather to see if it gets rid of the error before moving on to investigate why the SOAP service is responding so slowly. If the service is consistently this slow, you may have to consider offline/batch processing.

answered Feb 22, 2012 at 22:40

cmbuckley's user avatar

cmbuckleycmbuckley

39.9k9 gold badges77 silver badges91 bronze badges

8

Just wanted to share the solution to this problem in my specific situation (I had identical symptoms). In my scenario it turned out to be that the ssl certificate provided by the web service was no longer trusted. It actually turned out to be due to a new firewall that the client had installed which was interfering with the SOAP request, but the end result was that the certificate was not being correctly served/trusted.

It was a bit difficult to track down because the SoapClient call (even with trace=1) doesn’t give very helpful feedback.

I was able to prove the untrusted certificate by using:

openssl s_client -connect <web service host>:<port>

I know this won’t be the answer to everyone’s problem, but hopefully it helps someone. Either way I think it’s important to realise that the cause of this error (faultcode: «HTTP» faultstring: «Error Fetching http headers») is usually going to be a network/socket/protocol/communication issue rather than simply «not allowing enough time for the request». I can’t imagine expanding the default_socket_timeout value is going to resolve this problem very often, and even if it does, surely it would be better to resolve the issue of WHY it is so slow in the first place.

answered Jan 23, 2013 at 5:09

Manachi's user avatar

ManachiManachi

1,03016 silver badges30 bronze badges

I faced same problem and tried all the above solutions. Sadly nothing worked.

  1. Socket Timeout (Didn’t work)
  2. User Agent (Didn’t work)
  3. SoapClient configuration, cache_wsdl and Keep-Alive etc…

I solved my problem with adding the compression header property. This is actually required when you are expecting a response in gzip compressed format.

//set the Headers of Soap Client. 
$client = new SoapClient($wsdlUrl, array(
    'trace' => true, 
    'keep_alive' => true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'compression'   => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
));

Hope it helps.

Good luck.

joeybab3's user avatar

joeybab3

2952 gold badges7 silver badges24 bronze badges

answered May 26, 2018 at 10:19

Sanjay Mohnani's user avatar

2

I suppose it’s too late, but I have the same problem. I try the socket timeout but it doesn’t work.
My problem was that the client and the server where in the same physical server. With the client code working in the same physical server , I get this error, but, with the same client code moved to my localhost, requesting the server, (client and server was executed in two differents mechines) all works fine.

Maybe that can help someone else!

answered Jul 25, 2013 at 16:31

Jonathan Huet's user avatar

1

Setting 'keep_alive' to false worked for me:

new SoapClient($api_url, array('keep_alive' => false));

joeybab3's user avatar

joeybab3

2952 gold badges7 silver badges24 bronze badges

answered Jun 19, 2018 at 15:48

Thiago Sathler's user avatar

The configuration that has worked for me was defining at my php script the following parameters:

ini_set('default_socket_timeout', 5000);
$client = new SoapClient($url,array(
    'trace' =>true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'keep_alive' => false,
));

Please, comment.

The most important parameter definition, as per my experience with this issue was

ini_set('default_socket_timeout', '5000');

During my tests I have defined the default_socket_timeout to 5 seconds and the error ‘Error Fetching http headers’ was raised instantaneously.

I hope it helps you!

domdambrogia's user avatar

answered Nov 30, 2017 at 10:56

Marcelo Tonon Chiovatto's user avatar

I just wanted to add, for completeness sake, that similar to Manachi I received this message because the client certificate I was using required a passphrase and I accidentally had an extra character at the end of the passphrase. This post is just to offer up another suggestion for what to look into. If the host requires the use of a client certificate (via local_cert parameter) make sure you provide the correct path to the cert and the correct passphrase (if one is needed). If you don’t, it is very likely you will see this same error message.

answered Nov 6, 2013 at 0:09

borq's user avatar

borqborq

6817 silver badges15 bronze badges

None of the above techniques worked for me.

When I analyzed the request header from __getLastRequestHeaders, I saw the following:

POST /index.php/api/index/index/?SID=012345 HTTP/1.1
Host: www.XYZ.com

The API URL I had been using was different, like www.ABC.com. I changed the API URL to www.XYZ.com/index.php/api?wsdl, and then it worked.

Both URLs returned the same WSDL from the same server, but only one allowed login.

answered Feb 27, 2016 at 23:42

humbads's user avatar

humbadshumbads

3,2221 gold badge27 silver badges22 bronze badges

In recent releases from Zend SOAP client not having «connection_timeout» and «Keep_alive» parameters at all.

enter image description here

You can see the piece of code I have attached as an image. The only way to solve this issue to increase your default socket timeout in php.ini

default_socket_timeout = 1000

I hope it will solve your issue. Give an upvote if it works.

answered Jan 14, 2020 at 9:18

sivaprakash's user avatar

I had this problem and I checked, and in my case, was the Firewall. The PHP not show the error correctly. To perform the request, the Firewall answered:

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
...
<html
...
<h1>Direct Access IP is not allowed</h1>
...
</html>

The SoapClient expects the SOAP envelope but receives a HTML code.
That’s why PHP responds with: «Error Fetching Http Headers» because it can not understand what he received in response. To resolve the problem, contact your network administrator to verify if there is any Firewall, NAT or proxy getting in the way and then ask them to make the necessary arrangements.

hlscalon's user avatar

hlscalon

7,2844 gold badges33 silver badges40 bronze badges

answered Feb 4, 2014 at 22:45

Mauro's user avatar

MauroMauro

312 bronze badges

1

Please check for the response HTTP-Header. In my case, the following header was set on the API-Site:

<IfModule mod_headers.c>
    Header set Connection keep-alive
</IfModule>

It seems like the PHP SoapClient can’t deal with that option. As a result, the response body was empty, but content-length in the response-header has been set correctly.

Remove that line or change it to «close» solved my issue.

answered Aug 24, 2015 at 18:30

Matthias Kleine's user avatar

I had the same issue and tried the following by disabling keep_alive.

$api_proxy = new SoapClient($api_url, array('trace' => true, 'keep_alive' => false));

However, that didn’t work for me. What worked worked for me was disabling the SOAP cache. It appears to have been caching the wrong requests and after disabling I actually noticed my requests were executing faster.

On a linux server you can find this in your /etc/php.ini file.

Look for soap.wsdl_cache_enabled=1 and change it to soap.wsdl_cache_enabled=0.

Don’t forget to reload apache.
service httpd reload

answered Dec 16, 2016 at 18:17

SeniorDeveloper's user avatar

SeniorDeveloperSeniorDeveloper

8861 gold badge12 silver badges22 bronze badges

Another possible cause of this error could be some OpenSSL operations leaving not cleared errors. Put this piece of code before the SOAP request to clear them:

while (openssl_error_string()) {}

answered Oct 18, 2018 at 8:43

Furgas's user avatar

FurgasFurgas

2,7291 gold badge18 silver badges27 bronze badges

I got this same error and in my case the server I was sending the request to was replying with a 504 Gateway Time-out error. I didn’t realize this until I went to the URL in a browser that was being requested by the SOAP request:

eg.
https://soap-request-domain-here.com/path/to/file.wsdl

answered Jul 10, 2019 at 14:50

John Langford's user avatar

John LangfordJohn Langford

1,2322 gold badges12 silver badges15 bronze badges

We encountered Error fetching http headers on every second call of SoapClient::__soapCall(,). However, not every soap endpoint/soap server was affected.

It turned out that switching to http was working reliably for all servers, but connections via https/secure HTTP showed above symptoms.
The openssl_error_string() as suggested by Furgas did not return any errors.

It turned out that the misbehaving soap servers sent a HTTP-header with every response which lead to the soap client choking on the second soap call:
Connection: Upgrade, close. The well-behaving servers did not send a Upgrade on successive responses.

What worked for us:

  • setting keep_alive to false, as mentioned by Thiago
  • unsetting the Upgrade- and Connection-headers via .htaccess files

Although the well-behaving soap servers did not need any of this, the misbehaving once needed both the keep_alive set to false and the unsetting of the headers.

# .htaccess
Header unset Upgrade
Header unset Connection

The root-cause is still unclear, but there is a bug report at Apache regarding Upgrade headers when using HTTPS.

answered Aug 8, 2019 at 10:11

Richard Kiefer's user avatar

Richard KieferRichard Kiefer

1,8142 gold badges22 silver badges42 bronze badges

I have been getting Error fetching http headers for two reasons:

  1. The server takes to long time to answer.
  2. The server does not support Keep-Alive connections (which my answer covers).

PHP will always try to use a persistent connection to the web service by sending the Connection: Keep-Alive HTTP header. If the server always closes the connection and has not done so (PHP has not received EOF), you can get Error fetching http headers when PHP tries to reuse the connection that is already closed on the server side.

Note: this scenario will only happen if the same SoapClient object sends more than one request and with a high frequency. Sending Connection: close HTTP header along with the first request would have fixed this.

In PHP version 5.3.5 (currently delivered with Ubuntu) setting the HTTP header Connection: Close is not supported by SoapClient. One should be able to send in the HTTP header in a stream context (using the $option — key stream_context as argument to SoapClient), but SoapClient does not support changing the Connection header (Update: This bug was solved in PHP version 5.3.11).

An other solution is to implement your own __doRequest(). On the link provided, a guy uses Curl to send the request. This will make your PHP application dependent on Curl. The implementation is also missing functionality like saving request/response headers.

A third solution is to just close the connection just after the response is received. This can be done by setting SoapClients attribute httpsocket to NULL in __doRequest(), __call() or __soapCall(). Example with __call():

class MySoapClient extends SoapClient {
    function __call ($function_name , $arguments) {
        $response = parent::__call ($function_name , $arguments);
        $this->httpsocket = NULL;
        return $response;
    }
}

Answer by Salvatore Hansen

I know this won’t be the answer to everyone’s problem, but hopefully it helps someone. Either way I think it’s important to realise that the cause of this error (faultcode: «HTTP» faultstring: «Error Fetching http headers») is usually going to be a network/socket/protocol/communication issue rather than simply «not allowing enough time for the request». I can’t imagine expanding the default_socket_timeout value is going to resolve this problem very often, and even if it does, surely it would be better to resolve the issue of WHY it is so slow in the first place.,The SoapClient expects the SOAP envelope but receives a HTML code.
That’s why PHP responds with: «Error Fetching Http Headers» because it can not understand what he received in response. To resolve the problem, contact your network administrator to verify if there is any Firewall, NAT or proxy getting in the way and then ask them to make the necessary arrangements.,During my tests I have defined the default_socket_timeout to 5 seconds and the error ‘Error Fetching http headers’ was raised instantaneously.,It turned out that the misbehaving soap servers sent a HTTP-header with every response which lead to the soap client choking on the second soap call:
Connection: Upgrade, close. The well-behaving servers did not send a Upgrade on successive responses.

You can increase it like so:

ini_set('default_socket_timeout', 600); // or whatever new value you want

Answer by Regina Burns

This error is often seen when the default_socket_timeout value is exceeded for the SOAP response. ,Note from the SoapClient constructor: the connection_timeout option is used for defining a timeout value for connecting to the service, not for the timeout for its response., Error fetching http headers in SoapClient ,I’ve found that increasing default_socket_timeout in php.ini should fix it, but it did not work.

I’m trying to invoke a WS over https on a remote host:remote port and I get:

Error fetching http headers

 Here is the code:

$wsdl="myWSDL";

$client = new SoapClient($wsdl,array('connection_timeout'=>5,'trace'=>true,'soap_version'=>SOAP_1_2));

var_dump($client->__getFunctions());

try {
    $response=$client->myFunction("1","2","3");
         } catch (SoapFault $fault) {
    var_dump($fault);
    }
}


Answer by Ronan Knight

This error can appear on the client if there is a problem on the server side. For example, if the SOAP server is a PHP script with a parse error, the client will fail with this message.,Now refresh the client and watch for the error message. Any PHP errors with the server script will be shown.,The Contents are licensed under creative commons.,This whole game of headers that we are passing. I solved my problem with adding the compression header property. This actually require when you are expecting response in gzip compressed format.

I’m trying to create a soap connection to Magento’s web services, however I’m getting an error when I try and create an instance of the soap client class. I can view the wsdl file in firefox without problems and I can watch php make the request for the wsdl in apaches logs but it still fails. Nusoap can connect.

$proxy = new SoapClient('someaddress?wsdl');

The error is

<b>Fatal error</b>:  Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php:29
Stack trace:
[internal function]: SoapClient-&gt;__doRequest('&lt;?xml version=&quot;...',    'http://cornishw...', 'urn:Mage_Api_Mo...', 1, 0)
[internal function]: SoapClient-&gt;__call('call', Array)
/home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php(29): SoapClient-&gt;call(NULL, 'catalog_categor...', 5, 'giftshop')
/home/sites/xxx/xxx_main/system/application/libraries/MY_Loader.php(586): include('/home/sites/cor...')
/home/sites/xxx/xxx_main/system/application/libraries/MY_Loader.php(228): MY_Loader-&gt;_ci_load(Array, '')
/home/sites/xxx/xxx_main/system/application/modules/contentpage/controllers/contentpage.php(44): MY_Loader-&gt;view('contentpage_tem...', false, true)
[internal function]: Contentpage-&gt;index()
/home/sites/xxx in <b>/home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php</b> on line <b>29</b>

Answer by Blaze Weaver

When this error is encountered, there are three common solutions to head off the error by remedying either the timeout directly or how the API returns the results.,»Error Fetching http headers» is a common error to encounter when working with the SLAPI. Fortunately, it is not terribly difficult to avoid. This error most commonly met when working with a large sets of data and can be a bit cryptic, as it seems to imply some sort of connection issue. In truth, it is a client side error provided when a timeout occurs while waiting for a response from the API.,This varies depending on what client you are using to communicate with the SLAPI, but increasing your timeout limit to several minutes may help. Re-trying the request itself might also work. This is the easiest solution, but also the least likely to work long term.,
If this article contains any error, or leaves any of your questions unanswered, please help us out by
opening up a github issue.
Open an issue

"Error Fetching http headers" is a common error to encounter when working with the SLAPI. Fortunately, it is not terribly difficult to avoid. This error most commonly met when working with a large sets of data and can be a bit cryptic, as it seems to imply some sort of connection issue. In truth, it is a client side error provided when a timeout occurs while waiting for a response from the API.

"Error Fetching http headers"

Answer by Alia Escobar

Has this issue been resolved at your end? Or was it closed by accident?,

Sorry, something went wrong.
,
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
,Successfully merging a pull request may close this issue.

		$reportQuery->setDimensions([
			Dimension::DATE,
			Dimension::ADVERTISER_NAME,
			Dimension::LINE_ITEM_NAME,
			Dimension::AD_UNIT_NAME,
			Dimension::MASTER_COMPANION_CREATIVE_NAME
			]);

		$reportQuery->setColumns([
			Column::TOTAL_LINE_ITEM_LEVEL_IMPRESSIONS,
			Column::TOTAL_LINE_ITEM_LEVEL_CLICKS,
			Column::TOTAL_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS,
			Column::TOTAL_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS,
			Column::TOTAL_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS_RATE,
			Column::TOTAL_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS,
			Column::TOTAL_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS_RATE
			]);

		$reportQuery->setAdUnitView(ReportQueryAdUnitView::HIERARCHICAL);
		$reportQuery->setDateRangeType(DateRangeType::CUSTOM_DATE);
		$reportQuery->setStartDate(DfpDateTimes::fromDateTime(
			new DateTime('-4 days', new DateTimeZone('America/Phoenix')))->getDate());
		$reportQuery->setEndDate(DfpDateTimes::fromDateTime(
			new DateTime('now', new DateTimeZone('America/Phoenix')))->getDate());

		$this->logProgress('Creating a new Report Job.');
		$reportJob = new ReportJob();

		$reportJob->setReportQuery($reportQuery);`

Answer by Sadie Navarro

We use bingads PHP lib. Sometimes, when we try to make a call using GetCampaignCriterionsByIds or AddCampaignCriterions methods we get «Error Fetching http headers» but when repeat call we get success. Why does it happen? What does this error mean exactly?,The error seems not specific to the Bing Ads API. ,Where to place Bing API Code in Shopify,This error also repeats randomly by calling other API methods.

So this isn’t a solution to the problem, but it’s a work around that’s working for me:

 $failed = false;
 do {
     try {
         $poll_response = $this->ServiceClient->GetService()->PollGenerateReport($request);
         $failed = false;
     }
     catch(Exception $e) {
         $failed = true;
     }
 } while ($failed);

Answer by Lawson Graves

[2008-09-12 07:49 UTC] filip_stjernberg at hotmaol dot com

Description:
------------
I'm trying to use an existing webservice:
http://testhorizon.gothiagroup.com/AFSServices/AFSService.svc?wsdl

There is a simple test function called "HelloWorld" that returns the input "myVaule". This function dos not need authentification but its more advaced one do.

Really need this to work, have tried nuSOAP to but that gives me other problems.

Reproduce code:
---------------
This is the code I use:

try{
    $wsdl = 'http://testhorizon.gothiagroup.com/AFSServices/AFSService.svc?wsdl';
    $client = new SoapClient($wsdl,
    array(
          'soap_version' => SOAP_1_2,
          'trace'      => 1,
          'exceptions' => 1
    ));

    print($client->HelloWorld(array('myValue' => 'Test')));
    
} catch (Exception $e) {
    printf("Message = %sn",$e->__toString());
}

print "<pre>n";
  print "Request :n".htmlspecialchars($client->__getLastRequest()) ."n";
  print "Response:n".htmlspecialchars($client->__getLastResponse())."n";
  print "</pre>";

Expected result:
----------------
Hello from AFSService: Test

Actual result:
--------------
Message = SoapFault exception: [HTTP] Error Fetching http headers in /customers/veus.se/veus.se/httpd.www/Test/samples/AFSWS1.php:20 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://testhori...', 'http://tempuri....', 2, 0) #1 [internal function]: SoapClient->__call('HelloWorld', Array) #2 /customers/veus.se/veus.se/httpd.www/Test/samples/AFSWS1.php(20): SoapClient->HelloWorld(Array) #3 {main} 

nRequest :n<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://tempuri.org/"><env:Body><ns1:HelloWorld><ns1:myValue>Exor</ns1:myValue></ns1:HelloWorld></env:Body></env:Envelope>

nResponse:nn



Solution 1

This error is often seen when the default_socket_timeout value is exceeded for the SOAP response. (See this link.)

Note from the SoapClient constructor: the connection_timeout option is used for defining a timeout value for connecting to the service, not for the timeout for its response.

You can increase it like so:

ini_set('default_socket_timeout', 600); // or whatever new value you want

This should tell you if the timeout is the issue, or whether you have a different problem. Bear in mind that you should not use this as a permanent solution, but rather to see if it gets rid of the error before moving on to investigate why the SOAP service is responding so slowly. If the service is consistently this slow, you may have to consider offline/batch processing.

Solution 2

Just wanted to share the solution to this problem in my specific situation (I had identical symptoms). In my scenario it turned out to be that the ssl certificate provided by the web service was no longer trusted. It actually turned out to be due to a new firewall that the client had installed which was interfering with the SOAP request, but the end result was that the certificate was not being correctly served/trusted.

It was a bit difficult to track down because the SoapClient call (even with trace=1) doesn’t give very helpful feedback.

I was able to prove the untrusted certificate by using:

openssl s_client -connect <web service host>:<port>

I know this won’t be the answer to everyone’s problem, but hopefully it helps someone. Either way I think it’s important to realise that the cause of this error (faultcode: «HTTP» faultstring: «Error Fetching http headers») is usually going to be a network/socket/protocol/communication issue rather than simply «not allowing enough time for the request». I can’t imagine expanding the default_socket_timeout value is going to resolve this problem very often, and even if it does, surely it would be better to resolve the issue of WHY it is so slow in the first place.

Solution 3

I faced same problem and tried all the above solutions. Sadly nothing worked.

  1. Socket Timeout (Didn’t work)
  2. User Agent (Didn’t work)
  3. SoapClient configuration, cache_wsdl and Keep-Alive etc…

I solved my problem with adding the compression header property. This is actually required when you are expecting a response in gzip compressed format.

//set the Headers of Soap Client. 
$client = new SoapClient($wsdlUrl, array(
    'trace' => true, 
    'keep_alive' => true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'compression'   => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
));

Hope it helps.

Good luck.

Solution 4

I suppose it’s too late, but I have the same problem. I try the socket timeout but it doesn’t work.
My problem was that the client and the server where in the same physical server. With the client code working in the same physical server , I get this error, but, with the same client code moved to my localhost, requesting the server, (client and server was executed in two differents mechines) all works fine.

Maybe that can help someone else!

Solution 5

Setting 'keep_alive' to false worked for me:

new SoapClient($api_url, array('keep_alive' => false));

Comments

  • I’m trying to invoke a WS over https on a remote host:remote port and I get:

    Error fetching http headers

    using the PHP5 SoapClient; I can get the list of functions by doing $client->__getFunctions() but when I call $client->myFunction(...) I always get this error.

    I’ve googled and found that increasing default_socket_timeout in php.ini should fix it, but it did not work.

    Can anyone suggest me a solution?

    EDIT: here is the code:

    $wsdl="myWSDL";
    
    $client = new SoapClient($wsdl,array('connection_timeout'=>5,'trace'=>true,'soap_version'=>SOAP_1_2));
    
    var_dump($client->__getFunctions());
    
    try {
        $response=$client->myFunction("1","2","3");
             } catch (SoapFault $fault) {
        var_dump($fault);
        }
    }
    

    always ends in the error.

    How do I solve the problem?

  • I’ve tried to increase it at 600 but always get [«faultstring»]=> string(27) «Error Fetching http headers»

  • OK, then retry Wrikken’s suggestion above, except it’s not meant to be ini_set but another option in your array passed to the constructor. I am guessing he suggested this based on PHP #37054, and your error might be similar. Try a manual request using curl and -H "User-Agent:" and see if you get a Location header in the response.

  • Thanks for your attntion; i’ve tried as you suggested but with no way; when i do curl i see <soap:operation soapAction=»» style=»rpc»/> …can it help?

  • It would help if you could provide more information (e.g. a full output of your curl call with -v to see request/response headers).

  • Honestly, is there ever a situation where you want to allow the user to sit there and wait for 600 seconds for a response? So far I’ve found 3 stackoverflow posts with this question, and people keep suggesting ‘increasing the time limit’. It’s no surprise the answers aren’t being accepted. I haven’t solved the issue yet but I suspect it’s a network/socket related issue that usually causes this.

  • To be honest, it’s not a great answer — 600 seconds was just a stupidly high number that I arrived at by adding an extra zero :-) In fairness, I only meant it as a trial to see if it prevented the error, meaning you could gauge the actual response time. But if this was indeed the issue, and it was taking longer than 60 seconds to respond, then I guess addressing that response time would be more pertinent!

  • I had the same problem, I used this solution and it does not work for me neither.

  • Note: in SoapClient boolean options, do not know why, work just passing 0 and 1. example: array ( … ‘trace’ => 1, ‘exceptions’ => 0, … );

  • Awesome! Compression param helped me!

  • It can be either because the hostname resolves to your public IP and the router doesn’t know how to handle it correctly (just add your hostname to the hosts file and point it to 127.0.0.1) or because the server’s public and private ports might be different.

  • It worked for me. I got the response if records are less, if the response is huge then it hangs. So obviously timeout is happening and this helped. Thanks @cmbuckley

  • ‘user_agent’ => ‘Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0’, will make the response time less 100%

Recents

Добрый день.
есть такой код:

$client = new SoapClient("http://region.4sides.ru:6612/PiligrimServises.svc?wsdl", array('trace' => 1));
$data = $client->DepartureInfo(array("BarCod" => $barcod));

собственно он и выкидывает ошибку такого формата
SoapFault: Error Fetching http headers в функции SoapClient->__doRequest()

подскажите пожалуйста, в какую сторону копать?

  • Ошибка error failed to open file
  • Ошибка error executing updater binary in zip
  • Ошибка error exe 001 на телевизоре самсунг
  • Ошибка error exe 001 на телевизоре samsung
  • Ошибка error displaying the error page application instantiation error could not connect to mysql