locked
Webservice error: Request format is unrecognized for URL unexpectedly

    Question

  • Hi All,

    I have deployed webservice in live environment. On localhost it runs fine but on live environment it give following error when i access it throught browser on the remote terminal in IE7.

    http://xxxx.com/xx/xxxMaintenanceWS.asmx/LoadTopics

     

     Mubshir wrote:

    Server Error in '/' Application.

    Request format is unrecognized for URL unexpectedly ending in '/LoadTopics'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/LoadTopics'.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/LoadTopics'.]
       System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +490982
       System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +104
       System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +175
       System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +120
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    



    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210




    I have tried adding this to web.config but no luck...

     <protocols>
      <add name="HttpGet"/>
      <add name="HttpPost"/>
     </protocols>


    When i access this application through my c# client i get following error...

     Mubshir wrote:

    ---------------------------
    Exclamation
    ---------------------------
    An error has occured while loading Organization information.
    System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at RCOP.BusinessRuleTier.CPD.CPDProfile..ctor() in D:\xxx\Projects\xxx\xxxx\BusinessRuleTier\xxx\xxxProfile.cs:line 11
       at CPDMaintenanceWS..ctor() in d:\xxx\xxx\xxx\WebServices\WebServices\App_Code\xxxMaintenanceWS.cs:line 24
       --- End of inner exception stack trace ---

       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

       at System.Web.Services.Protocols.SoapHttpClientProtocol.InvokeAsyncCallback(IAsyncResult result)
    ---------------------------
    OK  
    ---------------------------



    Note:

    I have more than 30 .ASMX file all are running fine else only one(http://xxxx.com/xx/xxxMaintenanceWS.asmx/LoadTopics) is causing error. i have recently added this asmx file to my old services.

    Your help in this regard is really apperciated.

    Mubshir

    Wednesday, March 21, 2007 11:10 AM

Answers

  • Hi,

    I found the problem i was missing a configration element  entry on live web.config, i found this error by setting Off friendly error message in IE.

    Regards

    Monday, March 26, 2007 5:25 AM

All replies

  • Hi,

    I found the problem i was missing a configration element  entry on live web.config, i found this error by setting Off friendly error message in IE.

    Regards

    Monday, March 26, 2007 5:25 AM
  • Hi,

    I am having same error message. I am trying to invoke web services throught HTTP request.  Can you please describe your solution .

    System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetSecurityInfo'.
       at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
       at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
       at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
       at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&

    Thanks,

    Thursday, April 12, 2007 4:25 PM
  • Hi,

    I have resolved by problem by adding following to my web.config file.  I think you need to add this if you are using .net 2.0. it is not require

    for 1.1.  Anyway, I still need to figure out the way to invoke my .asmx file by passing the form authentication. I use form authentication in my

    application. If i just go to URL and type the address to the .asmx file, i am getting redirect to login page.  How do it by pass the login page for

    my .asmx files only.  Please let me know if anyone has any solution.

    <webServices>
    <protocols>
      <add name="HttpGet"/>
    <add name="HttpPost"/>
    </protocols>
    </webServices>

    Thursday, April 12, 2007 4:46 PM
  • Adding the section:

    <webServices>
    <protocols>
      <add name="HttpGet"/>
    <add name="HttpPost"/>
    </protocols>
    </webServices>

     

    beneath

     <system.web>

    section solved my problem when using a VBS-file to acces my webservice from a remote Windows 2003 server.

     

    Thanks

    Wednesday, April 18, 2007 8:56 AM
  •  

    Hi,

    I am also facing the same problem. when i invoke the web method it first show:

    HTTP 500 Internal server Error.

    and then when i refresh the page it gives: Request format is unrecognized for URL unexpectedly

    with stack trace......

     

     

    I am using Framework2.0 in window XP.

    I tried out:

    <webServices>
    <protocols>
    <add name="HttpGet"/>
    <add name="HttpPost"/>
    </protocols>
    </webServices>

    on web.config of my Web Service.

    But again its showing:

     HTTP 500 Internal server Error.

    And now even on refreshing it shows the same that is: HTTP 500 Internal server Error.

     

    If you had done something else to correct this problem then please let me know..

     

    Thanks,

    Maneesha

    Wednesday, January 23, 2008 11:29 AM
  • Please create a separate thread. I almost ignored your post because this thread is marked as Answered.

     

    Friday, January 25, 2008 11:42 AM
    Moderator
  • Did a solution ever found for those people who added <protocols> to web.config but still got a 500 error?
    Tuesday, September 13, 2011 9:04 AM
  • Hi guys,

       I was facing the same problem. I resolved it by adding the try..catch block in the web methods. 

    The 500 error is raised by web service if the exception is un-handled in your web methods. 

    FYI: If you have any parameter required for your methods, try to use proper format for query string reserved character like '&' or '+'.  This will work fine when you invoke the method through POST. But the same parameter will throw error if you GET. 

    This is exactly what happened in my case.

    Hope this may solve someone's problem here. 

    Thanks,

    Naveen


    Thank You, Naveen email:naveen_dkt@yahoo.co.in

    Tuesday, June 12, 2012 6:24 PM