bigtv
bigtv

Reputation: 2711

Error connecting to secure web service!

I am consistently receiving the following error when trying to create a Web Reference in Visual Studio 2008 to a 3rd party web service.

'Received an unexpected EOF or 0 bytes from the transport stream'

I get the same error too if I try to generate a proxy class vith the wsdl.exe tool.

I can confirm the web service is operating as it should as I can connect to via 3rd part tools such as the SOAPUi client.

Am I missing somehing simple?


I have since found the following post: http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/thread/37c376a3-f50c-4b57-a1df-83dc43fcddbf

While it describes my issue exactly, I am not sure I understand the solution. Is anyone able to clarify?

Upvotes: 2

Views: 1264

Answers (3)

heringer
heringer

Reputation: 3208

Too old, but in case someone else is struggling, here is another try that worked for me in legacy code:

System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072;

This is TLS 1.2, but the value does not exist in the enumeration in .NET 2.0.

Upvotes: 0

Chris Woodruff
Chris Woodruff

Reputation: 1278

(From the MSDN Forums referenced above)

Scenario:

Local side: Asp.net 2.0 Web Service, IIS 6.0

Remote side: Java Web Services, Apache, Local ssl certificate(https)

Solution:

In short, the problem was when the web service tried to connect to establish the ssl handshake, by default uses TLS and in this case the java web services was SSLv3, but the error never showed this in plain text.

In order to config this you have set to:

System.Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Ssl3

After this the service will do the hand shake and continue.

Upvotes: 2

bigtv
bigtv

Reputation: 2711

In the end I downloaded Visual Studio 2010 trial and it guess what it worked!

Don't ask me why.

Upvotes: 1

Related Questions