The underlying connection was closed: An unexpected error occurred on a send

R

Robert Walter

I know this has been done many times before but I think I have a more
unique case.

I am using an XML-RPC wrapper (http://www.xml-rpc.net/) to call a
webservice which I connect to using SSL and client certificates. I
have a library containing the calling code that is referenced in a
Windows Service and this service should wakeup when required and call
the XML-RPC service.

I get the 'The underlying connection was closed: An unexpected error
occurred on a send' when calling it from the service. But when I call
it from a windows application it works fine.

Now I have looked round to see why this could be happening and people
have suggested changing the KeepAlive property of the Web Request to
false. I have done this but no change in what happens.

Does anyone have any idea why this could be happening and how I could
go about fixing it?

Thanks in advance,



Rob.
 
R

Robert Walter

I know this has been done many times before but I think I have a more
unique case.

I am using an XML-RPC wrapper (http://www.xml-rpc.net/) to call a
webservice which I connect to using SSL and client certificates. I
have a library containing the calling code that is referenced in a
Windows Service and this service should wakeup when required and call
the XML-RPC service.

I get the 'The underlying connection was closed: An unexpected error
occurred on a send' when calling it from the service. But when I call
it from a windows application it works fine.

Now I have looked round to see why this could be happening and people
have suggested changing the KeepAlive property of the Web Request to
false. I have done this but no change in what happens.

Does anyone have any idea why this could be happening and how I could
go about fixing it?

Thanks in advance,



Rob.

I find that if I make a local request without SSL and Client
Certificates it works fine.

I have set the proxy value of the web request object to
GlobalProxySelection.GetEmptyWebProxy() so it shouldn't be using a
proxy server.

I get the error on every request I make, not randomly like some people
appear to get.

Thankfully I have worked out a way round it if required involving
wrapping the request in a webservice and calling that webservice from
my Windows Service but that way isn't nice so if anyone has any ideas
they'd be greatly appreciated.

Thanks,



Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top