I am using a webservice client that was created from a WSDL file
in .Net 1.1.
The client ALWAYS works the first time I call it.
The second call returns one of two exceptions. It either returns the
error:
A) The connection has been closed on a receive : Unable to read data
from the transport connection: An existing connection was forcibly
closed by the remote host.
OR B) it gives me a 403 Access Forbidden Error.
Any subsequent attempts always return the 403 error.
I have been working on this for days on end and here is more
information that might be of use.
The header file that comes back from the vendor's website shows they
are running IIS 5.
The original client sent to me was written in VS 2003. I opened it in
VS2003 (.Net 1.1) and it works 100% of the time without any problems.
After I open/upgrade the project in VS 2005 and run it on .Net 2.0, I
get the errors described above. I have to stop debugging and restart
the app to get another message through.
We are using certificates to authenticate and communicating over an
https link (no sniffing allowed).
I have tried overriding the GetWebRequest call with various
combination of the lines below and nothing worked.
webRequest.KeepAlive = false;
//webRequest.Proxy.IsBypassed(webRequest.RequestUri) ; //
No proxy being used anyway
//webRequest.ProtocolVersion =
System.Net.HttpVersion.Version10;
//webRequest.ServicePoint.Expect100Continue = false;
In the code below, I get a response form the first button click, but
the troubles come on any subsequent clicks.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim ws As New SomeVendor.WebServiceService()
Dim certPath As String = "somepath\certname.cer"
ws.Url = "https://urladdress"
ws.ClientCertificates.Add(X509Certificate.CreateFr omCertFile(certPath))
ws.Timeout = 10 * 60 * 1000
Dim response As String = Nothing
Dim xml As String = "<message>xmlstring</message>"
Try
response =
ws.getFullQuotePremiumWebService(xml)
TextBox1.Text = response
Catch ex As Exception
TextBox1.Text = ex.Message
End Try
End Sub
I would greatly appreaciate any help on this.
TIA
Doug Ferguson