Web Service, arrays and HTTP POST method

Discussion in 'ASP .Net Web Services' started by adlionel, Nov 3, 2005.

  1. adlionel

    adlionel Guest

    Hi,

    I'm using .net Framework 2.0 Beta 2.

    I've developed a Web Service in C#. One of the Web Methods of this web
    service takes a string array as parameter. With SOAP call it's working
    flawessly with both empty and non empty arrays.

    Now I want to call this web service with POST (from a classic ASP
    client). When my string array is not empty there is no problem (for
    example A=value1&A=value2). But when this array is empty (let's call it
    A), I'm passing no A parameter in the "POST query string" (sounds logic
    for me). Then the following error occurs:

    System.NullReferenceException: Object reference not set to an instance
    of an object. at
    System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection
    collection) at
    System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest
    request) at
    System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at
    System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

    So my question is : is this error a .Net bug? Or shall I provide a
    specific syntax to explicitly tell that the A array is empty?

    If this is a bug, is it corrected in the .net 2.0 final version or is
    there a way to avoid it? (I don't want to pass A=&otherparam as empty
    string for a specific array entry is different of an empty array)

    Thanks for your answers
    adlionel, Nov 3, 2005
    #1
    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. Ron Peleg, Creo
    Replies:
    2
    Views:
    762
    Ron Peleg, Creo
    Feb 13, 2006
  2. Brybot
    Replies:
    6
    Views:
    1,149
    John Saunders [MVP]
    Jul 9, 2007
  3. James Appleby
    Replies:
    1
    Views:
    2,487
    Donkey Hot
    Feb 6, 2008
  4. Philipp
    Replies:
    21
    Views:
    1,106
    Philipp
    Jan 20, 2009
  5. DotNetGruven

    Web Service only offers SOAP, where did HTTP-POST go?

    DotNetGruven, Jun 17, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    365
    DotNetGruven
    Jun 17, 2004
Loading...

Share This Page