Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web service and adding extra methos params

Status
Not open for further replies.

Badgers

Programmer
Nov 20, 2001
187
US
Hi,

I have a webservice which existing clients are bound to, if I add an extra param to the method would I break the existing compatibility? or would it be best I add a second method. (Overloading doesn't work very well in web servicess).

Thanks
 
TIMSTAR said:
if I add an extra param to the method would I break the existing compatibility?

That would depend entirely on if your existing method allows for optional parameters.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
The last time I tried, overloading a web method wasn't possible, or at the very least a pain in the neck. Not sure if much has changed since I tried. Since you have clients using it, it would make more sense to just create a new web method and let them know that it exists instead of having them change code to call the existing ones.
 
'overloading' is not strictly the same thing as simply having optional parameters that can be omitted if not required.


Optional Parameters for c#


For vB.net you use the keyword "Optional" before the parameter and declare a default value in the function declaration


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
What's your point with that last post?
WebMethods are different than Subs or Functions.

Optional parameters are not allowed in webmethods.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top