I have to call a Soap-Service in a loop so I have to call this service many times.
Which is the better way to handle this:
A) create the soap-client once and use it for the calls in the loop.
B) create the soap-client object for every call.
The response can be a huge array.
At the moment, I use way A.
I think, it is getting slower at the end of the loop.
If I use B, I have the feeling that it runs faster but that could be wrong.
What is the best approach for this case.
The best approach is to create one soap-client and use it for the calls in the loop. You can find a similar question here.