HTTP status 405: Method not allowed

R

rk325

Yes, I've seen many posts about this type of error, and none of the
solutions people applied worked for me. So please read this one
carefully and help me if you can.

I have a web service application installed in a Windows 2000 SP4 Domain
control server. It is running IIS 5.0. I can access the WS from its own
web page, and, when I access it from the server where it is installed,
I can run its methods.

However, I cannot access this WS from an ASP.NET web application. The
error I get is:

The request failed with HTTP status 405: Method not allowed.
: : :
Exception Details: System.Net.WebException: The request failed with
HTTP status 405: Method not allowed.

yes, the stack trace tells me that it crashes on the first WS method
the web site tries to hit.

The WS has been setup to accept 1) Anonymous Access, 2) Integrated
Windows Authentication.
In the code to access this WS I am passing the credentials to access
the WS......and if the credentials are incorrect (e.g. typo) I get the
"401: Access Denied" error.

The domain control server, had already IIS installed when I installed
the .NET 1.1 Framework. But when I looked at the users I cannot find
the ASPNET user anywhere. I also tried running "aspnet_regiis -i" then
"iisreset", and no luck, still the same 405 error.

Without the ASPNET user, I tested this server by running the simple
Hello World asp.net application; it ran find. I even tested it with a
more complex application that queries the local SQL server db and it
worked fine. So I guess I do not need the ASPNET user, or do I?

Please I've been pulling my hair for 2 days already on this issue, and
do not know how to solve it.
 
M

Mujtaba Syed

Hi:

Make sure you have not disabled the SOAP protocol bindings in
[machine|web].config
When you test the web service using its own help page, the binding used is
HTTP-POST (.NET 1.1) or HTTP-GET (.NET 1.0).
When you use a proxy, the SOAP protocol binding is used.

<webServices>
<protocols>
<add name="HttpSoap" /> <----------- This line should _not_ be
commented.
<!-- <add name="HttpPost"/> -->
<!-- <add name="HttpGet"/> -->
<add name="HttpPostLocalhost" />
<add name="Documentation" />
</protocols>
</webServices>

Thanks,
Mujtaba.
 
R

rk325

Thanks Mujtaba.
I looked at the machine.config file and the line you mention above is
uncommented. There are no similar lines in web.config just in case.
I'm still getting the same 405 error.
 
D

Dan Rogers

Hi,

I have a feeling this might be a result of an improperly formed SOAP
request. When you make a call thru the proxy, it uses HTTP Post to post a
SOAP envelope and HTTP header. The http header has a SoapAction field that
needs to be properly formed to match a method that the service accepts. if
your client sends the wrong Action value, you will get a method not allowed
error returned to the client.

Have you tried making your application call your service code on your
development machine? This would help isolate the conditions (old version
of windows, old version of IIS, .NET framework) and help you remove the
security considerations.

Also, for Windows Auth (you didn't mention how you are making the call),
have you made sure that keep-alives are allowed on both the server IIS site
settings for your app, and in the proxy itself?

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top