VBAHole22 Posted June 7, 2005 Posted June 7, 2005 I have a web service method that I would like to have optional parameters so that I don't have to write 3 overloaded methods and name them all differently. Wouldn't it be easier to just pass in an object from the client? That way I wouldn't get errors when the client doesn't submit the double that my web service defines (because it is optional in the method). I could receive the object and then work on it server-side in my service. How do I go about doing this? I guess I am confused because of the web service client that .NET creates by default for my service. Can I just override that ugly default page and make my own client? My users will not want to use the page itself anyway. They are going to have their own client pages. Am I missing something here? Quote Wanna-Be C# Superstar
Administrators PlausiblyDamp Posted June 7, 2005 Administrators Posted June 7, 2005 (edited) Try the following... _ Public Function Test(ByVal i As Integer) Test(i, 0) End Function _ Public Function Test(ByVal i As Integer, ByVal j As Integer) End Function although in the test page it will display both test1 and test2 create a sample app and reference the web service - you will just get 2 versions of the Test method. If you are referring to the page you get when you run a web service then do not worry - that is just there as a convenience for the developer. In practice you would never expect a user to access it Edited March 3, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
VBAHole22 Posted June 7, 2005 Author Posted June 7, 2005 Did not know that, thank you. Why is it that you double parameters are required yet things like string you can leave blank? I can't even get into my code to handle the null because the service blows up first. Quote Wanna-Be C# Superstar
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.