Re: System.Net.WebException: The request failed with HTTP status 4

Tech-Archive recommends: Speed Up your PC by fixing your registry



I've been searching around the forums for answers to this but not finding
anything substantial. My env is XP Pro / .NET 2.0. The web service in
question is written in Java on a WebLogic box. I can open the wsdl in IE and
see/invoke the methods exposed to me on the box in question. But when I try
to run code that uses the same service I get the error above. I have
another box (Win2003/.NET 2) which runs the same code fine. I can't help but
think it is a configuration problem on my first XP machine.

I know this is kind of general but can anyone provide a quick checklist to
start? Any feedback appreciated.

Thanks in advance.

Sal

"Steven Cheng[MSFT]" wrote:

Thanks for your response Tim,

Sorry that I've missed your point on using apache server. Anyway, Glad that
you've figured out the problem through configuring the .net application's
proxy setting. For the proxy, we can also programmatically configure it
for or webservice proxy( or HttpWebRequest component) through its Proxy
property. e.g:

MyMath.Math math = new MyMath.Math();

IWebProxy proxyObject = new WebProxy("http://proxyserver:80";, true);
math.Proxy = proxyObject;

int total = math.Add(8, 5);

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
Thread-Topic: System.Net.WebException: The request failed with HTTP status 4
thread-index: AcYYalbeGWccHlLwTLeMFtU+51ygvg==
X-WBNR-Posting-Host: 192.76.82.90
From: =?Utf-8?B?VGltIFJleW5vbGRz?= <tim.reynolds@xxxxxxxxxxxxx>
References: <C8E91C5F-D07D-4C49-A497-0A98B3773A0C@xxxxxxxxxxxxx>
<#Bvrvv8FGHA.2040@xxxxxxxxxxxxxxxxxxxx>
<gw9VuRAGGHA.1236@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: System.Net.WebException: The request failed with HTTP status 4
Date: Fri, 13 Jan 2006 09:54:02 -0800
Lines: 98
Message-ID: <A3EBFF12-801D-4EDF-81CE-6220AD4C03FE@xxxxxxxxxxxxx>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:13351
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Ok - SOmeone told me about the following which I put in my windows
exe.config
file and I guess this basicallyi said don't use the default proxy settings
and this resolved the problem.

<system.net>
<!-- don't use system default proxy -->
<defaultProxy>
<proxy usesystemdefault="false"/>
</defaultProxy>
</system.net>

I am not sure if it uses any proxy now, nor how I could tell it to use
proxy
for one app connection but not another, but those are other new
questions/issues. This post can be closed....



"Steven Cheng[MSFT]" wrote:

Hi Tim,

I think Martin's suggestion is reasonable since the webservice used to
work
correctly on dev box , so there should not contains problems in code
logic.
And network environment should be the first thing we can check. Also,
you
can check the IIS log on the server machine to see whether the request
actually arrive the server...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
From: "Martin Kulov" <kulov@xxxxxxxxxxxxxxxx>
References: <C8E91C5F-D07D-4C49-A497-0A98B3773A0C@xxxxxxxxxxxxx>
Subject: Re: System.Net.WebException: The request failed with HTTP status
404:
Date: Fri, 13 Jan 2006 01:00:05 +0200
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="Utf-8";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Message-ID: <#Bvrvv8FGHA.2040@xxxxxxxxxxxxxxxxxxxx>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: vpn-pppoe-213-240-243-80.megalan.bg 213.240.243.80
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:13334
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

"Tim Reynolds" <tim.reynolds@xxxxxxxxxxxxx> wrote in message
news:C8E91C5F-D07D-4C49-A497-0A98B3773A0C@xxxxxxxxxxxxxxxx
Our .Net application calls a web method of aplpication 2 that resides on
their Apache server. When I as a developer C#, Studios 2003, make the
call
to
their web method from my desktop, I receive no exceptions - completes
fine.
...
When I deploy my project to the development server and call (using the
same
url) the same web method with the same data, I receive the following
exception:

System.Net.WebException: The request failed with HTTP status 404: Not
Found.
...

Hi Tim,

may be your development server do not see the app2 server. Check if there
is
connectivity between them.

Regards,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD




.



Relevant Pages

  • RE: Which Proxy Server....
    ... HTTP, FTP, Telnet, SSL, NNTP and E-Mail all use TCP and can be easily ... MANY proxy servers exists for this purpose. ...
    (Security-Basics)
  • [SubWeb] NEW http proxy/reverse proxy
    ... SubWeb is a proxy. ... HTTP flows in the line of HTTPush, ... This list is provided by the SecurityFocus Security Intelligence Alert ...
    (Pen-Test)
  • Re: Error 49, socket problem?
    ... lo0: flags=8049mtu 16384 ... proxy: HTTP: attempt to connect to 127.0.0.1:81 failed ... based apps on the server fail, yet nothing in /var/log/messages indicating a ...
    (freebsd-net)
  • Re: HTTPS Using Web Proxy
    ... couple of the sites using the direct access method. ... Error Code: 504 Proxy Timeout. ... On the internal network properties / Web proxy page I enabled SSL on ... I added HTTPS to the same rule as HTTP is working on; ...
    (microsoft.public.isa)
  • Re: ISA 2004 Server Errors
    ... Tunneling SSL Through a WWW Proxy ... CONNECT is really a lower-level function than the rest of the HTTP methods, ... Through ISA Server ...
    (microsoft.public.isa)