I have created a web service, which when I call in my browser presents the
text form etc. When I click the button, I get this error:
System.ArgumentException: Cannot convert to System.Int32.
Parameter name: type ---> System.FormatException: Input string was not in
a
correct format.
at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatP rovider provider)
at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
at System.Web.Services.Protocols.ScalarFormatter.From String(String
value,
Type type)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.ScalarFormatter.From String(String
value,
Type type)
at
System.Web.Services.Protocols.ValueCollectionParam eterReader.Read(NameValu
eCollection
collection)
at
System.Web.Services.Protocols.HtmlFormParameterRea der.Read(HttpRequest
request)
at System.Web.Services.Protocols.HttpServerProtocol.R eadParameters()
at System.Web.Services.Protocols.WebServiceHandler.In voke()
at
System.Web.Services.Protocols.WebServiceHandler.Co reProcessRequest()This
seems to happen only when I have parameters of different data types, e.g.:
Works:
======
<WebMethod()> _
Public Function GetAddresses(ByVal a As String, ByVal b As String) As
DataSet
Causes Error:
===========
<WebMethod()> _
Public Function GetAddresses(ByVal a As String, ByVal b As Integer) As
DataSet
Any ideas/suggestions will be much appreciated.
Regards,
Simon.
--
I am using the free version of SPAMfighter for private users.
It has removed 2053 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!