I have a WCF web service hosted in IIS using HTTPS. Both the service and client app are written in C#. The first web service call that the client app makes takes over 15 seconds to complete. Once that initial call is made, subseqent calls complete in about 100 milliseconds. For testing, I have a simple method: string Ping(int val); that simply echoes back the number passed in as a string.
The odd thing is that a user a thousand miles away reported this problem but I was not experiencing it on my development machine. I was only seeing the first request taking 2 to 3 seconds. Now virtually every client is reporting that the first request takes more than 15 seconds.
Is this normal behavior for a C# client? Has anyone experienced this problem?
My web service binding is configured as follows:
<basicHttpBinding>
<binding
name="BasicHttpBinding_IMyWebSvc"
maxBufferSize="16777216"
maxReceivedMessageSize="16777216"
messageEncoding="Mtom">
<readerQuotas
maxDepth="1024"
maxStringContentLength="262144"
maxArrayLength="16777216"
maxBytesPerRead="16777216"
maxNameTableCharCount="16777216"
/>
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
Edit: This problem gets weird.
I wrote a test client using trimmed down proxy code that had nothing but the Ping() test method. Ran the test and it still took >15 seconds. Started changing the clients buffer sizes since the Ping() function does not need large buffers and the problem went away. Restored the buffer sizes to their original values and the problem did NOT come back. Ran the real client and the first call completed in 1.2 seconds. Now I cannot reproduce the problem on my development PC.