Re: HttpWebRequest.GetRequestStream:Unable to connect to the remot

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello John,

You were right. I did have InnerException, but due to the limited debugging
means on the deployment machines I did not notice that. I have checked the
event log on the deployment machine, but found nothing. As far as the host of
the remote web service, I have no control over it.

Here is the complete exception description:

System.Net.WebException Unable to connect to the remote server at
System.Net.HttpWebRequest.GetRequestStream() at ...

Inner exception: System.Net.Sockets.SocketException Message: 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 | at System.Net.Sockets.Socket.DoConnect(EndPoint
endPointSnapshot, SocketAddress socketAddress) at
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket
s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,
IAsyncResult asyncResult, Int32 timeout, Exception& exception)

This looks very strange to me as the service does react promptly on HTTP GET.
Thanx in advance, if you have ideas!


"John Saunders [MVP]" wrote:

"Edgile" <Edgile@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AB2B35F9-E7D6-4491-D5-9155C3985F0A@xxxxxxxxxxxxxxxx
Hello Everyone,

System.Net.WebException Unable to connect to the remote server at
System.Net.HttpWebRequest.GetRequestStream()

This is the exception I am confronted with when I deploy my website on a
W2003 Standard Edition server though the same code runs perfectly on other
two developer servers (XP Professional). This GetRequestStream method is
executed on the web server when invoking a remote web service. Then it
waits
until a timeout and I get this exception. The web service invokation uses
HTTP POST. If I fire an HTTP GET from a browser of the problematic server
to
the same remote web service (same URL), I get the correct response
immediately that is an error report insturcting me to use HTTP POST . I am
pretty certain that this is not a software issue, but rather a security
settings problem of W2003 Server. Can you help me with any advise?

Was this the entire exception message? In particular, I suspect there was an
inner exception detailing _why_ it was unable to connect to the remote
server.

Additionally, was there anything in the event logs either for the invoking
server or the remote server?
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer


.



Relevant Pages

  • Re: IIS ASP.net Web Services Disconnected
    ... does show no exception, and it is a perfect run on the server-side. ... the connection idle for more than 1/2 hours, ... the server thinks the file is send without problem. ... At the client-side, it times out after 1.5 hours if nothing happen. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: System.Security.SecurityException {Beginner working with ASP.NET}
    ... seems like the server is runnning with partial trust. ... In the page_load I fill the data adapter, ... grid and close the connection. ... I get this exception when attempting to view my webform in IE6. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to reconnect to a db automatically?
    ... Dim MyConn as new Odbc.connection ... 'The connection could not be opened ... Catch ex as exception ... For instance if the sql server is just rebooting after an update, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to reconnect to a db automatically?
    ... was tested at application launch to make sure it was valid and could ... 'The connection could not be opened ... Catch ex as exception ... For instance if the sql server is just rebooting after an update, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)