Calling a WebService through HTTP GET ? (HELP!)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benne Smith

    Calling a WebService through HTTP GET ? (HELP!)

    Hi,

    I have a simple webservice, with one function on the following local path :



    I would like to call it, using HTTP GET (or some form of simple, url with
    all the parameters in), like this;



    But it does not work ? It comes with the following error;

    Thanks,

    Benne

    Server Error in '/activation' Application.
    ----------------------------------------------------------------------------
    ----

    Request format is unrecognized.
    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.InvalidO perationExcepti on: Request format is
    unrecognized.

    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:


    [InvalidOperatio nException: Request format is unrecognized.]

    System.Web.Serv ices.Protocols. WebServiceHandl erFactory.CoreG etHandler(Type
    type, HttpContext context, HttpRequest request, HttpResponse response) +388

    System.Web.Serv ices.Protocols. WebServiceHandl erFactory.GetHa ndler(HttpConte x
    t context, String verb, String url, String filePath) +94
    System.Web.Http Application.Map HttpHandler(Htt pContext context, String
    requestType, String path, String pathTranslated, Boolean useAppConfig) +699

    System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p
    ..Execute() +95
    System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
    completedSynchr onously) +173




  • Edward Yang

    #2
    Re: Calling a WebService through HTTP GET ? (HELP!)

    There is a subtle difference between .NET Framework 1.0 and 1.1 regarding
    the 'protocols' that are permitted to communicate with a WebService.

    By default, you can use SOAP, GET or POST method to communicate with a
    WebService running on 1.0. But in version 1.1, only SOAP is enabled by
    default.

    You have to add the following settings to you Web.config file to re-enable
    GET/POST methods.

    Example:

    <configuratio n>
    <system.web>
    <webServices>
    <protocols>
    <add name="HttpGet" />
    <add name="HttpPost" />
    </protocols>
    </webServices>

    Edward

    "Benne Smith" <dont@write.to. me.directly.com > wrote in message
    news:3f447b41$0 $9513$4d4eb98e@ news.dk.uu.net. ..[color=blue]
    > Hi,
    >
    > I have a simple webservice, with one function on the following local path[/color]
    :[color=blue]
    >
    > http://localhost/testws/tester.asmx
    >
    > I would like to call it, using HTTP GET (or some form of simple, url with
    > all the parameters in), like this;
    >
    > http://localhost/testws/tester.asmx/...o&param2=world
    >
    > But it does not work ? It comes with the following error;
    >
    > Thanks,
    >
    > Benne
    >
    > Server Error in '/activation' Application.
    > --------------------------------------------------------------------------[/color]
    --[color=blue]
    > ----
    >
    > Request format is unrecognized.
    > 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.InvalidO perationExcepti on: Request format is
    > unrecognized.
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the current[/color]
    web[color=blue]
    > request. Information regarding the origin and location of the exception[/color]
    can[color=blue]
    > be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    >
    > [InvalidOperatio nException: Request format is unrecognized.]
    >
    > System.Web.Serv ices.Protocols. WebServiceHandl erFactory.CoreG etHandler(Type
    > type, HttpContext context, HttpRequest request, HttpResponse response)[/color]
    +388[color=blue]
    >
    >[/color]
    System.Web.Serv ices.Protocols. WebServiceHandl erFactory.GetHa ndler(HttpConte x[color=blue]
    > t context, String verb, String url, String filePath) +94
    > System.Web.Http Application.Map HttpHandler(Htt pContext context, String
    > requestType, String path, String pathTranslated, Boolean useAppConfig)[/color]
    +699[color=blue]
    >
    >[/color]
    System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n+IExecutionSte p[color=blue]
    > .Execute() +95
    > System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
    > completedSynchr onously) +173
    >
    >
    >
    >[/color]


    Comment

    Working...