The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Web service versioning

I have a web service in .net. In version 1 I have the function foo(bar) which takes in a bar message that has two fields, 1 and 2. If I want to make a new version of the ws that adds field 3 to the message, is there any way for me to specify that field 3 is allowed to be missing from the message? So clients who have already created their proxies from my old ws don´t have to update their clients, but can send old style messages with only fields 1 and 2, but on my end the web service will parse it so that I get my message with fields 1 and 2 intact but field 3 null or missing somehow?
Friday, February 03, 2006
Use the params keyword.

eg, your original method:

public void foo(Bar bar1, Bar bar2, params object[] paramlist) {


paramlist then becomes an optional array of parameters, which you could cast to type Bar in your method if necesary
adsense wannabe Send private email
Friday, February 03, 2006
Add a new method "ServiceVersion", which you save
with any session information (or the ip), and
look up when they call other messages...

Friday, February 03, 2006
Consider changing / extending your api to a more doc/literal approach.

public void foo(Bar bar)

and then use XSD to define what a Bar is.  You can then make your application accept different versions of Bar and extend it along that line.

Friday, February 03, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz