Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2006

Tip: Looking for answers? Try searching our database.

Webservice and Input Parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony Biondo Jr - 21 Jul 2006 20:50 GMT
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()

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.