Comments inline:
> I've never used C# nor have I created Web Services, so I am in the process
> of finding tutorials on the web and going through them. I found this one
[quoted text clipped - 38 lines]
> 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()
[quoted text clipped - 5 lines]
> even at all? Is the value null - since I didn't put in a value? But how wo
> uld you compare an int to null!?
Yes, if you do not provide a value for the int parameter in the web page,
then the call fails already before your code in the web method gets a chance
to execute. If you want to allow passing nulls then one way to do this is to
wrap the int into a simple class and use it as the parameter to the web
method
public class NullableInt
{
public int Value;
}
[WebMethod()]
public void ThisMethodAllowsNullArgument(NullableInt nullableInt)
{
if (nullableInt == null) ...
}
Note that if you use this class then you can't invoke the web method through
the browser any more because the browser form only works with primitive
types.
> Question #2:
> Is it possible to have default parameters (so it would default to a certain
> value)?
ASP.NET Web Services have no support for default values out of the box. For
more flexibility, you could pass e.g., an XML document as a parameter
instead of an int, and implement any default value logic in application
code.
> Question #3:
> How do I DEBUG a Web Service? I set a breakpoint so I could try to figure
> out what the Number value was - I pressed F5, it launched a browser, I
> clicked the Invoke button - it didn't reach my breakpoint.
Debugging works as you would expect except in this case the exception occurs
before execution reaches your breakpoint.
Regards,
Sami