SOAP request returns with HTTP/1.1 405 Method not allowed

Discussion in 'ASP .Net Web Services' started by Gerrit, Sep 7, 2006.

  1. Gerrit

    Gerrit Guest

    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
     
    Gerrit, Sep 7, 2006
    #1
    1. Advertising

  2. Gerrit

    Gerrit Guest

    Gaurav Vaish (www.EduJiniOnline.com) schrieb:

    > > 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?

    >
    > 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
     
    Gerrit, Sep 7, 2006
    #2
    1. Advertising

  3. "Gerrit" <> wrote in message
    news:...
    > Gaurav Vaish (www.EduJiniOnline.com) schrieb:
    >
    >> > 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?

    >>
    >> 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.


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

    John
     
    John Saunders, Sep 7, 2006
    #3
  4. Gerrit

    Gerrit Guest

    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


    Gaurav Vaish (www.EduJiniOnline.com) schrieb:

    > > 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).
    >
    >
    >
    >
    > 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:
    >
    >
    >
    >
    >
    > --
    > Happy Hacking,
    > Gaurav Vaish | http://www.mastergaurav.com
    > http://articles.edujinionline.com/webservices
    > -------------------
     
    Gerrit, Sep 12, 2006
    #4
  5. Gerrit

    Joined:
    Sep 13, 2012
    Messages:
    1
    Hi!
    Did you found solution?
    Thanks
     
    , Sep 13, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GlennLanier
    Replies:
    2
    Views:
    21,504
    GlennLanier
    Jun 10, 2005
  2. Eric
    Replies:
    3
    Views:
    1,510
    Joerg Jooss
    Feb 27, 2007
  3. Lisa Ngo
    Replies:
    3
    Views:
    490
    Jan Tielens
    Jan 18, 2004
  4. rk325

    HTTP status 405: Method not allowed

    rk325, Dec 15, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    727
    Dan Rogers
    Dec 16, 2004
  5. RK
    Replies:
    5
    Views:
    1,065
    Jim Ley
    Aug 8, 2004
Loading...

Share This Page