+ Start a Discussion
Adrian van WykAdrian van Wyk 

SOAP API Slow first connection

Hi Everyone,

I am having some trouble with my .net integration with my salesforce org. Namely the first connection to through the API.

The first connection can take anywhere from 8 - 12 seconds which is quite a while considering its a simple lead creation form, after making the initial connection the interaction with my API is quite fast. I have searched everywhere for a solution to this problem and come up with nothing.

Any suggestions?
Daniel BallingerDaniel Ballinger
The first call being slow with WCF is documented in Accessing Force.com SOAP Endpoints with .NET (https://developer.salesforce.com/blogs/developer-relations/2014/09/accessing-force-com-soap-endpoints-net.html) and Why is the first WCF client call slow? (http://stackoverflow.com/q/10859832/54026)

If you don't want to switch to using a Web Reference have a look at How to: Improve the Startup Time of WCF Client Applications using the XmlSerializer (https://msdn.microsoft.com/en-us/library/aa751883(v=vs.110).aspx)
Gnani MatavalamGnani Matavalam
Yes, with SOAP first connection will always sucks big time. My recommendation would be create a simple REST class in APEX which will create a lead and access the rest url in .net program and post the data. I personally use this method and it's really quick.

Good luck :)

Cheers,
Gnani