V
V
vbelbel2017-04-13 10:20:07
PHP
vbelbel, 2017-04-13 10:20:07

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
            )
        );

I would be very grateful if there are ideas in which direction to dig (settings on hosting, 1c, etc.).
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question