3

I'm attempting to consume a web service that has been creating using Soap::Lite (Perl). I'm consuming the service using C#. For the most part it works fine. I can grab responses and parse them as I see fit. However, I have certain calls that do not work.

I get the following message: "An existing connection was forcibly closed by the remote host"

It's my understanding that the server is probably cutting off the connection for whatever reason. I'm trying to find that reason. I think it's happening due to the size of the details of some responses. I've got one in particular that will always fail and when I view the XML from the SOAP response, it is always truncated at the exact same spot as if it gets to that spot and has hit a size limit.

So, I've done everything I can think of on the client size such as changing the MaxReceivedMessageSize and timeout settings, etc. I've noticed that I can increase timeouts and the execution time subsequently increases, but the diagnostics logging I'm doing always stops at the same spot.

I've also written a class that allows me to view the raw XML and again, it stops at the same spot.

I'm thinking maybe something on the server needs to changed but everything I've tried doesn't work. The service is hosted on a web server running IIS 6.

Does anyone have any suggestions for what I can do on either the client and/or server side?

Thanks

EDIT


I should note that there is no WSDL file for me to use. The application I'm working with is the only time I've ever worked with SOAP::Lite and from what I can tell it doesn't generate a WSDL.

@e36M3 - Thanks for the suggestion. I had never heard of soapUI. I installed it and tried it out and I can see many uses for it so I will be keeping it in mind for the future. Unfortunately it seems to be build around WSDL testing and I can't see how to test with it without providing a WSDL which is a problem given this particular situation.


Here is some of the relevant data from my trace logging. It starts with where the invalid xml ends and ends with the error information.

System.Net Verbose: 0 : [5772] 000031E0 ;/map>.</data
System.Net Verbose: 0 : [5772] 000031E0 >. System.Net Verbose: 0 : [5772] 000031E0 esp1:MRWebServic
System.Net Verbose: 0 : [5772] 000031E0 es__getIssueDeta
System.Net Verbose: 0 : [5772] 000031E0 ilsResponse> System.Net Verbose: 0 : [5772] 000031E0 AP-ENV:Body> System.Net Verbose: 0 : [5772] 000031E0 AP-ENV:Envelope>
System.Net Verbose: 0 : [5772] Exiting ConnectStream#15566556::Read() -> 12880#12880< br/> System.Net Verbose: 0 : [5772] ConnectStream#15566556::Read()
System.Net.Sockets Verbose: 0 : [5772] Socket#20784002::Receive()
System.Net.Sockets Error: 0 : [5772] Exception in the Socket#20784002::Receive - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
System.Net.Sockets Verbose: 0 : [5772] Exiting Socket#20784002::Receive() -> 0#0
System.Net.Sockets Verbose: 0 : [5772] Socket#20784002::Dispose()
System.Net Error: 0 : [5772] Exception in the HttpWebRequest#63722612:: - The underlying connection was closed: An unexpected error occurred on a receive. System.Net Verbose: 0 : [5772] ConnectStream#15566556::Close()
System.Net Verbose: 0 : [5772] Exiting ConnectStream#15566556::Close()

Minsc
  • 309
  • 4
  • 10
  • Make sure those specific call do not crash on the server side. – Adi May 13 '11 at 13:34
  • 1
    Have you tried executing the call from soapUI or similar? This will help you rule out .NET as being the reason why it fails. – e36M3 May 13 '11 at 13:50

1 Answers1

1

In your binding for the web service in the app.exe.config should be a setting for the maximum received message size. The default is maxReceivedMessageSize="65536". Increasing the value should allow the client app to receive all of the data.

Mike Chess
  • 2,758
  • 5
  • 29
  • 37
  • I had already tried that method. I have created a binding in my web.config and added an endpoint that uses that binding. The only way I know how to associate those with my service consumer though is via a ServiceContract. From my understanding this is for a WCF service though, so I'm not sure if the binding is actually being hit. Like I've said though, when I increase the endpoint timeout, the execution time subsequently increases. – Minsc May 13 '11 at 16:52
  • I've also added – Minsc May 13 '11 at 16:52