Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# SOAP Client instantiate time is slow

Tags:

c#

I have a web service I'm calling and upon investigation I see the creation of the client is taking about 0.5-1 second alone. This is using web reference .net 2.0.

SomeWS.SomeWSSoapClient client = new SomeWS.SomeWSSoapClient(); // takes 0.5-1 seconds

Is this normal? Is it fetching something from the service endpoint that I can stop?

I compared it to adding via a service reference and while the client takes a short time to instantiate (0.2 secs) the method call takes a lot longer and the overall time is longer.

What can I do to speed up the instantiate time? Which method should be quicker?

thanks a lot! Ash

like image 940
ashman786 Avatar asked Jan 19 '26 02:01

ashman786


1 Answers

Not sure if you have gotten an answer yet or not, but I believe it has something to do with the full scope of the web service, I have an application currently connected to another web service that takes 5-10 sec to instantiate because the WSDL is somewhere in the MB range. To work around this, I went through the work to send and receive the SOAP requests through raw XML and Web Client, sine I only use a fraction of what the WS offered.

If anyone else has a better idea, I'm all ears!

like image 183
Brian Avatar answered Jan 21 '26 16:01

Brian



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!