SOAP request returns with HTTP/1.1 405 Method not allowed

G

Gerrit

Hello,

I hope this is teh right group to ask.
I'm having some problems with a Web Service. The response of requests
is always:

HTTP/1.1 405 Method not allowed..
Server: Microsoft-IIS/5.1


Situation:

My Web Serice makes use of MS WSE 2.0.

The Web.config is configured so that all requests towards a ashx file
are handled by my RoutingHandler.

<httpHandlers>
<add type="Philips.ICIConnector.IciDispatcher.RoutingHandler,
IciDispatcher" path="*.ashx" verb="*" />
</httpHandlers>


Depending on the configuration of the system that is accessing my Web
Service, I may receive the following message:


1st Case:
------------
POST / HTTP/1.0..
content-type: text/xml..
content-length: 677..
accept: text/xml,text/html..
soapaction:
"http://inqmy.com/soapdispatcher/rpc/bcbici/IciSystemBean"..
user-agent: SAP Web Application Server (1.0;620)..
host: 130.139.41.47:8200..
accept-encoding: gzip..
sap-language: E....

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
......

And the response will be:

HTTP/1.1 405 Method not allowed
Server: Microsoft-IIS/5.1
Date: Fri, 07 Sep 2006 12:04:29 GMT
Allow: OPTIONS, TRACE, GET, HEAD
Content-Type: text/html
Content-Length: 112



With a different configuration I will receive message in the following
format:

2nd Case:
------------
POST /IciDispatcherService/icidispatcher.ashx HTTP/1.1..
Host: 130.139.41.47:8200..
Content-Type: text/xml; charset="UTF-8"..
Connection: close..
Content-Length: 744..
SOAPAction:
"http://inqmy.com/soapdispatcher/rpc/bcbici/IciUserBean"....

<?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
......

And the response will be:

HTTP/1.1 100 Continue..
Server: Microsoft-IIS/5.1

etc.... Well, the request will be processed just fine.


Remarks:
For *.ashx files IIS is configured for GET, HEAD, POST, and DEBUG
Default document points to a *.ashx file, i.e. should end up in my
RoutingHandler


Question:
How can I avoid the 405 error?
How do I succeed that the request (as mentioned in case 1) are handled
by my "RoutingHandler"?
Is this problem caused because the first request uses HTTP/1.0 and the
second HTTP/1.1?
Or is this problem caused because the first request goes to the root
while the second request sends the request nicely direct to the
appropriate Web Application?


System:

WinXP
IIS 5.1


Any help appreciated.

Thanks,

Gerrit
 
G

Gerrit

Gaurav said:
Firstly, there already exists a handler for *.ashx... I don't think you need
to reregister it unless you have a very specific requirement.

Secondly, it seems that you want to do some internal routing of the web
service depending upon the request parameters... I would suggest taking a
more standards-based approach by looking into WS-Addressing.
You will, yes, need to look into WSE.


--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://articles.edujinionline.com/webservices
-------------------

Thanks for the reply.

Further info:
The reason why I do this routing of Web Requests is: My application
actually implements 6 different web Services and the application we are
intergating with just send the requests either to:

POST /IciDispatcherService/icidispatcher.ashx HTTP/1.1.........

and then it will work just fine or all request are send to:

POST / HTTP/1.0...........

and then a HTTP405 is returned.

The mentioned ashx file does not exist, it is just a dummy link to
trigger WSE 2.0 to execute the routingHandler.
The routing handler makes use of WSE 2.0 will check certain parameters
of the SOAP request and then forward the request to the real web
service.

Actually I have the feeling that this error returned by IIS and that it
never reaches the .Net part.
So, I'm kind of clueless how to tackle this.

Thanks,

Gerrit
 
J

John Saunders

Gerrit said:
Thanks for the reply.

Further info:
The reason why I do this routing of Web Requests is: My application
actually implements 6 different web Services and the application we are
intergating with just send the requests either to:

POST /IciDispatcherService/icidispatcher.ashx HTTP/1.1.........

and then it will work just fine or all request are send to:

POST / HTTP/1.0...........

and then a HTTP405 is returned.

The mentioned ashx file does not exist, it is just a dummy link to
trigger WSE 2.0 to execute the routingHandler.
The routing handler makes use of WSE 2.0 will check certain parameters
of the SOAP request and then forward the request to the real web
service.

Actually I have the feeling that this error returned by IIS and that it
never reaches the .Net part.
So, I'm kind of clueless how to tackle this.

I notice that the one which fails uses HTTP 1.0, and the one that succeeds
uses 1.1. Maybe that's it?

John
 
G

Gerrit

Hi,
thanks for the answer. We finally managed to get the requests coming in
as:

POST /IciDispatcherService/icidispatcher.ashx HTTP/1.0 and then
everything looks already much better. In that case the requests enter
my Routinghandler and it is possible to process them.

Thanks a lot,

Gerrit

Actually I have the feeling that this error returned by IIS and that it
never reaches the .Net part.
So, I'm kind of clueless how to tackle this.

Ok... got your problem.
(Thanks John for the hint).


------------
POST / HTTP/1.0
content-type: text/xml
content-length: 677
accept: text/xml,text/html
soapaction: "http://inqmy.com/soapdispatcher/rpc/bcbici/IciSystemBean"
user-agent: SAP Web Application Server (1.0;620)
host: 130.139.41.47:8200

Technically wrong request.
The HTTP/1.0 version does not know about the "Host" header. It was
introducted in version 1.1

The 1.0 request should have been:

POST http://130.139.41.47:8200/ HTTP/1.0
----Other--Headers--As--Above--Host--May--Be--Absent



--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://articles.edujinionline.com/webservices
-------------------
 

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