Comsumir Web service in SOAP with large volume of data, TIME OUT

Asked

Viewed 129 times

1

I need to take a lot of data from a web service in SOAP, but depending on the query the server does not hold, I have seen in some articles, that this can be solved by compression of xml or sending in parts, but I did not find examples.

I tried to loop and chain the requests for each record, but it didn’t work, it understands as if it was just a request.

foreach ($this->vg['marcas'] as $key => $value) {

  $xmlr = new SimpleXMLElement('<CustumeSearch></CustumeSearch>');

  $paramsSoap = array(

    'categoria' => $tipoDados['nome'],

    'idMarca' => $key,

    'idModelo' => 0,

    'HashSeguranca' => 'xxxx'
  );


  // Looping responsavel por adicionar propriedade e valores ao XML exemplo (codigoAnuncio => 292)
foreach($paramsSoap as $key => $value) {

    $xmlr->addChild($key, $value);

  }

    $marcas = $this->vg['soap']->__soapCall(
        "RetornarVersoes" ,
        array($xmlr)
    ); ...

Fatal error: Uncaught Soapfault Exception: [Soap:Server] System.Web.Services.Protocols.Soapexception: Server was Unable to process request.

1 answer

1


Is the webservice outside or is it yours? If it’s from the outside, you don’t have control over it, but instead of having a giant loop, you can have 2 or 3 starting from different places, one at index= 0 another at index = 10000 and you make a request for each of them and in the end you aggregate the answers in an array or something.

  • Good alternative, I will try, but I do not know if it will work because every time the index of looping alternates I restart the SOAP connection, and still not right.

  • You have to have a "shared memory" that is fixed, global variables that you change, that are in another file or something

Browser other questions tagged

You are not signed in. Login or sign up in order to post.