Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAP method call extremely slow

I am working on a project which relies heavily on SOAP calls. The problem is that load times a re extremely long.

$client = new SoapClient("https://link.to.wsdl");
$client = $client->GetDestination(array(
"parameter1" => $param1,
"parameter2" => $param2
));

Now I did some timing and the first part of the code(initiating an object $client) takes about 2 seconds, very acceptable. But when calling getDestination it adds about 10 seconds loading time. This is with every get or set method that I call.

This code is running on php 5. The methods are written in .net 4.x

Does anyone know why this is and how it can be solved?

EDIT: ping statistics 10 packets transmitted, 10 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 1.086/2.320/3.624/1.157 ms

like image 714
user2285451 Avatar asked Aug 29 '26 09:08

user2285451


1 Answers

First, you should enable WSDL caching using the soap.wsdl_cache_enabled ini value or using the $options param of the SoapClient constructor. This would prevent PHP from downloading the wsdl again and again and will speedup the constructor (2 seconds it also very long)

To speedup the method calls itself, I need more information. Are you able to use wireshark to introspect the network communication between your app and the soap server?

like image 115
hek2mgl Avatar answered Sep 01 '26 02:09

hek2mgl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!