A
adlionel
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
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