Link to home
Start Free TrialLog in
Avatar of nediam1234
nediam1234

asked on

Problem consuming web service over HTTPS. (unexpected EOF)

Hi,

I'm having a problem consuming a SOAP web service with C#.

the WS is written in java, and the plan is to call it over SSL. The exact same web service is currently running on both http and https, and I can call both using a browser. However, when trying to invoke a function with a  C# console application, only the http one works.

the error I get is this one:
--------------------
The underlying connection was closed: An unexpected error occurred on a send.
Received an unexpected EOF or 0 bytes from the transport stream.
--------------------

I've tried exporting the certificate file from Internet Explorer and used this code to add the certificate, but it still does not work.
this.ClientCertificates.Add(X509Certificate.CreateFromSignedFile(@"C:\ver.cer"));

I get the same error when I try to add a reference by using "Add Web Reference..."


As I said before it's the exact same web service running on both http and https and both work through a browser, while it only works over http from my C# app.


Any ideas? Could the problem be on the server side of things?
ASKER CERTIFIED SOLUTION
Avatar of KPMT-Technician
KPMT-Technician
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin