[eluser]nevsie[/eluser]
Hi All, this is maybe a bit more general, but it is within my CI build.
In short i am using PHP5 SoapClient to connect to an web service and i am suffering a lag that i find unacceptable. I am a bit out of my depth on this, but cannot see anything i am doing particularly wrong. A simple code snippet as below:
Code:
$options = array(
'soap_version'=>SOAP_1_2,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient('http://mydomain.com/api/webser.asmx?WSDL', $options);
$response = $client->ThisMethod(array("psXMLParams" => "<?xml version='1.0' encoding='utf-8' ?><ThisMethod><ANme>123456789</ANme></ThisMethod>"));
echo "<pre>";
print_r($response);
echo "</pre>";
Now when i run this i see a delay of about 4-8 seconds (in total) for a response. Yet from desktop software sending the same piece of XML i get instant response, as does the provider of this server using .net framework.
Now it seems to me that when i setup "new SoapClient" this is where the lag occurs, and the the actual request part is pretty instant.
I am not expert enough to understand the finer points of this, and hence i am asking advice about what "new SoapClient" actually does, and what settings would aid me here. I get the feeling it goes off and finds out all the available methods, and so if there are a lot of methods (250 in this case) available then it has a lot of work to do, hence the lag.
Therefore if the above is correct can i do something about this, i.e. stop it checking the methods, use a different method to send the request, etc?
But i might also be way off the mark...
So any advice or thoughts will be greatly appreciated.
Thanks in advance, N