开发者

Passing an optional parameter to a webservice in vb.net

开发者 https://www.devze.com 2023-01-22 17:35 出处:网络
Is there a way to pass an optional parameter to a webservice, instead of having to overload the method?

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 Action开发者_StackOverflowA + ActionB.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消