Y
Y
Yuri Denisov2015-01-20 13:48:32
PHP
Yuri Denisov, 2015-01-20 13:48:32

How not to wait for SOAP connection to close?

Good evening. There is one site that works only with authorization. When a user is authorized to add new records to the database, he makes a SOAP request to the WSDL service. Sometimes this service hangs and it turns out the user is waiting for a response for a couple of minutes. The problem is that while there is a request to the service, if the user opens the same site in the next tab, it does not open until the request is completed. As I understand it, an apache process is assigned to an authorized user along with the session, and until he completes one task, he does not start the second. How can this be avoided? So that while in one tab there is a request to the service, it was possible to work in the second? Or is it technically impossible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2015-01-20
@SilenceOfWinter

Write the connection completion flag to the session, check this value when connecting:

if (!isset($_SESSION['soap_connect']) {
   $_SESSION['soap_connect'] = false;
}

if ($_SESSION['soap_connect'] ) {
  echo "уже соединяемся...";
} else {
   $_SESSION['soap_connect'] = true;
   echo 'соединение и запрос...';
   $_SESSION['soap_connect'] = false;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question