Several requests in a single connection

Help
dayer
2013-08-02
2013-08-02
  • dayer
    dayer
    2013-08-02

    Hi all,

    I need to do a a lot of request to a webservice. Someone has told me that I could connect to the server and send every request through the same connection for save time and resources, but not how.

    However, I don't know if NuSOAP offers this feature. The useHTTPPersistentConnection() method could be useful for this purpose if I put all the call methods in a loop? I've tried it, but with a netstat I've checked NuSOAP does several connections from different ports.

    Thanks.

    This is my basic example (without error checkings):

    $connection = new nusoap_client ( 'thewsdlurl', true, false, false, false, false, 30, 60);
    $connection->useHTTPPersistentConnection();

    foreach($data as $something){
    $result = $connection->call ( 'remoteFunction', $something );
    unset($data[$something]);
    sleep(1);
    }

    unset($connection);