Answer the question
In order to leave comments, you need to log in
How to fix an error on the first SOAP connection?
Hello.
There is a 1c database with the availability of goods and stock balances. On the site, a SOAP request is made on the button to receive the balances. The request itself, getting the response and updating the data via ajax.
Problem in the following:
At the first request the answer does not come and does not produce an error. After the first request everything works fine and fast. By the first request, I mean the following - a request after a long break, for example, everything works all day and the next day in the morning the first request hangs again. It is very difficult to understand what the problem is, since it does not write errors in the logs. Arises apparently at a stage of the first connection. With the connection itself, timeouts and other settings, I did everything I could.
Just in case, the connection itself:
ini_set("soap.wsdl_cache_enabled", 0);
$context = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$SOAPclient = new SoapClient(
"http://xxx.xx.xx.xx:xx/xx/xx/xx.1cws?wsdl",
array(
'location' => "http://xxx.xx.xx.xx:xx/xx/xx/xx.1cws",
'login' => "xxx",
'password' => "xxx",
'trace' => true,
'exceptions'=>true,
'features' => SOAP_USE_XSI_ARRAY_TYPE,
"connection_timeout" => 10,
'stream_context' => $context
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question