Hi Everyone:
I noticed when I am debugging my web service if I do not provide it with a
value for a a input field that is a datatype Integer it throws an error like
the following. My question is, how do I trap this since it is happening on
the input? Has anyone encountered this issue?
thanks,
Anthony J Biondo Jr
Product Manager of Web Services
Keystone Mercy Health Plan
System.ArgumentException: Cannot convert to System.Int32.
Parameter name: type ---> System.FormatException: Input string was not in a
correct format.
at System.Number.StringToNumber(String str, NumberStyles options,
NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
at System.Web.Services.Protocols.ScalarFormatter.FromString(String value,
Type type)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.ScalarFormatter.FromString(String value,
Type type)
at
System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueC
ollection collection)
at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest
request)
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
Murtaza - 24 Jul 2006 06:59 GMT
how are your testing your webservice, is it by the default Interface given by
the webservice, my suggestion is that instead of integer u take it as object
then try to type cast it in integer if an exception is thrown then catch n
react appropriately, this will surely help your cause.
> Hi Everyone:
>
[quoted text clipped - 29 lines]
> at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()