Radu094
Radu094

Reputation: 28414

Troubleshoot SoapHttpClientProtocol connection problem

I get a timeout when using a SOAP client on a production server:

System.Net.WebException: The request timed out
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0 
  at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00000] in <filename unknown>:0 

When trying to ping the other endpoint from that computer, it works, even telnet-ing to port 80 works, so it's not a connectivity problem (I think).

The same code works fine on another computer, it's just the production one that experiences this problem. Any ideeas how to approach troubleshooting this?

Upvotes: 1

Views: 1644

Answers (2)

Radu094
Radu094

Reputation: 28414

Ok, finally troubleshooted this and 16 non-stop hours later this is what I came up. It's strange enough and convoluted and weird,that it warrants a post here for posterity:

Step 1:

Create a web project referencing a class library that references npgsql.dll (which in turn references Mono.Security.dll ). Add a webservice reference in the web project and use it in some page.

SOAP client now works fine

Step 2: (and this took 10 hours to isolate)

Add a Class1.cs in the referenced class library and make that class uses a class from npgsql.dll, then use that class in your web project, but use someplace where the code IS NEVER USED.

SOAP client now crashes with timeout

How could code that was never called change the behaviour of the SOAP client was beyond me for the better part of 16 hours?

Answer

When referencing a class from npgsql.dll (even if the code was never called), the npgsl.dll and Mono.Security.dll were copied into the bin folder.

And through some unkown reason, the Mono.Security.dll prevens the SOAP client from making uncertified connections.

Simply deleting the Mono.Security.dll from the bin folder fixed the problem immediately.

I have no ideea why Mono.Security.dll is needed, or what it does that messes up the SOAP, or how come I can delete it from the bin folder and have everything running just as well.

Well, and that is the story of the weirdest bug I've seen in a looong time.

Upvotes: 1

silverfox
silverfox

Reputation: 5272

You can enable Network Tracing, append trace logs to question would be helpful.

Upvotes: 2

Related Questions