From a scalability perspective, some of the people I have spoken to have suggested that this problem has only recently begun to happen because the web service is getting called more often. So, bugs that you might get away with start to come to the surface that were not evident before. They think that is what we are experiencing.
.NET Programming
Last Comment
Tom Knowlton
8/22/2022 - Mon
lojk
I just posted a comment in another question that should answer this question for you quite nicely.. :-)
In case I can't find the sample code, can you show me in a code snippet how to close the connection?
lojk
Just checked on my wcf4 service if you browse to the .svc url you get the sample..
here is the output of that page though, warts and all...
---------------------------------------------
svcDataSync Service
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
C#
class Test
{
static void Main()
{
IsvcDataSyncClient client = new IsvcDataSyncClient();
// Use the 'client' variable to call operations on the service.
// Always close the client.
client.Close();
}
}
Visual Basic
Class Test
Shared Sub Main()
Dim client As IsvcDataSyncClient = New IsvcDataSyncClient()
' Use the 'client' variable to call operations on the service.
' Always close the client.
client.Close()
End Sub
End Class
https://www.experts-exchange.com/questions/27630876/Necessary-or-optional-to-close-a-webservice-client-connection.html