Cannot consume webservice via http get

Discussion in 'ASP .Net Web Services' started by Dan, Apr 22, 2008.

  1. Dan

    Dan Guest

    Hi I wrote the following webservice

    [WebMethod]
    public void test()
    {
    return ;
    }

    I added this in the web.config file:
    <webServices>
    <protocols>
    <add name="HttpPost"/>
    <add name="HttpGet"/>
    </protocols>
    </webServices>

    but when I try to consume the service via httpGet I get this error:

    System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
    at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
    at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
    HttpContext context, HttpRequest request, HttpResponse response, Boolean&
    abortProcessing)
    Dan, Apr 22, 2008
    #1
    1. Advertising

  2. Dan

    aashraf Guest

    Hi,

    You are probably calling the web service using Query String with passing
    some parameters (hidden fields). If so the web service is not being able to
    parse the provided parameters and shows the error. You need to check for the
    proper parameters that the web service is expecting

    "Dan" wrote:

    > Hi I wrote the following webservice
    >
    > [WebMethod]
    > public void test()
    > {
    > return ;
    > }
    >
    > I added this in the web.config file:
    > <webServices>
    > <protocols>
    > <add name="HttpPost"/>
    > <add name="HttpGet"/>
    > </protocols>
    > </webServices>
    >
    > but when I try to consume the service via httpGet I get this error:
    >
    > System.IndexOutOfRangeException: Index was outside the bounds of the array.
    > at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
    > at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
    > at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
    > HttpContext context, HttpRequest request, HttpResponse response, Boolean&
    > abortProcessing)
    >
    >
    aashraf, Aug 14, 2008
    #2
    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. Paul Hermans

    Consume php webservice in asp.net

    Paul Hermans, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    931
    bruce barker
    Jun 10, 2004
  2. quentin compson

    call a webservice via http get

    quentin compson, Aug 13, 2004, in forum: Java
    Replies:
    2
    Views:
    2,524
    Omar Khan
    Aug 15, 2004
  3. weetat

    Consume Webservice in java

    weetat, Apr 4, 2007, in forum: Java
    Replies:
    3
    Views:
    27,167
    weetat
    Apr 4, 2007
  4. dgleeson422111

    consume local web service -ok consume remote service - Not OK

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    1,602
    dgleeson422111
    Jan 31, 2010
  5. M B HONG 20

    Consume .NET Web Service with HTTP-POST/GET

    M B HONG 20, Jul 22, 2005, in forum: Javascript
    Replies:
    2
    Views:
    233
    Martin Honnen
    Jul 23, 2005
Loading...

Share This Page