Reputation: 4807
Is there a way to pass an optional parameter to a webservice, instead of having to overload the method?
If the webservice user is accessing the webservice directly, I want to do ActionA, if the user is accessing the webservice through my web interface, I want to do ActionA + ActionB.
Upvotes: 1
Views: 5763
Reputation: 3474
no, you can't really have optional params for a service.
Even if an input parameter for a Web service method is optional, you must still include it and set the parameter value to null
Supplying Web Service Method Arguments
So, its optional to a degree, that you dont have to supply a value, but you're still going to have to write null
instead. Overloading is the 'normal' way to do this.
Upvotes: 2