I have an ASP.NET application that calls other web services through SSL (outside the application). I simply added a web reference (https://url/some.asmx) and used the web services and it works well. However, my questions are, how is the connection (channel) managed? is the connection to web services dropped after each web services call? or do they use the same connection (channel) for the subsequent calls? if they do, how long is the trusted connection kept alive?
+1
A:
Classic ASMX web services maintain the connection for a single request - that's why the methods you call via the web service class must be static. A SOAP call is very similar to a plain vanilla HTTP Request:
- Open connection to URL
- Pass in request - get/post, etc
- Server renders an XML (SOAP) response
- Connection is closed
- Client processes response.
The web service framework wraps most of this so that you can conveniently access the web service as if it were a local object, but there is no server-side object instance persistence any more than there is for an ASPX page.
WCF services, on the other hand, maintain the connection until the proxy object is closed. This gives you a LOT of power, but, of course, with great power comes great responsibility.
update: link regarding ssl caching:
David Lively
2009-11-05 16:57:32
Thanks for a quick response. So, if I have 100 users visiting our site and all requests a page that calls the web service, each go through SSL handshake through the process?
Kevin
2009-11-05 17:19:46
The SSL handshake should happen between your server and the server that hosts the service. If you require SSL for the browser to access your page, that is a separate process. I believe the SSL handshake will occur for your first request from your server to the webservice server.
David Lively
2009-11-05 17:31:28
See link I added to the post above
David Lively
2009-11-05 17:33:07