Answer the question
In order to leave comments, you need to log in
Why is PHP SoapClient closing the connection?
I am using php SoapClient to send SOAP request. When sending, no errors are recorded, but there is no response. The following is fixed on the server: HTTP Server: connection closed prematurely by client. I looked through tcpdump - indeed, a packet with the F flag leaves the client. I
try to send everything the same (packet / http headers) via soapui - there are no errors on the server, I get a response from the server.
Any ideas where to dig into php SoapClient ?
Answer the question
In order to leave comments, you need to log in
Are you trying to send via soapui from the same machine where the server is installed? If so, then you may need to make settings in the built-in firewall (for example, in the Windows firewall) so that PHP has the right to climb into the network (and, accordingly, the scripts it executes).
I found the reason)
In my wsdl, wsdl: output was missing, that is, the soap client did not wait for a response from the service and closed the connection. And the server for some reason did not digest this behavior.
As an option, in order not to edit all wsdl, you can override the __doRequest method to force 0 to be passed to $one_way:
class MySoapClient extends SoapClient
{
public function __doRequest ($request, $location, $action, $version, $one_way = 0)
{
return parent::__doRequest ($request, $location, $action, $version, 0);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question