Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Wednesday, June 14, 2006

Warning, rough notes:

I went to a notable talk this morning about versioning web services using WCF (though, many of the concepts could have been applied to ASMX too, or for that matter, any web service technology). The basic question the session tried to answer was how do you adjust a contract over time (version it) so that you don't break existing cilents?

In short, there are two potential answers:

  1. Put up a completely seperate and new endpoint,
  2. Carefully adjust what you currently have.

Simple in theory, but in practice the second part is typically the more difficult one. The benefit of the first is that you don't haev to worry about breaking any clients in the field as the original logic isn't touched; however you will more than likely experience code-bloat. The second option is tougher to write as you have to make sure what you're touching dosen't break existing clients, but it's also more conservative as you typically can reuse existing blocks of code (less code = fewer bugs, etc).

If you must adjust your existing service contract (option #2), then you typically can do so in one of three ways:

  1. Add new stuff - new types
  2. Extend old stuff - add new functions or fields
  3. Change old stuff - adjust parameter types, etc.

The 3rd option is usually the least preferrable, and if you're faced with this then it's recommended to just create a new endpoint (service) altogether. Adding new stuff is simple as you simply add new types and they don't interfere with the existing contracts. Extending older stuff, however, is possible but takes some thought:

  1. The DataContract serializer (I believe it's called) expresses members of data types in alphabetical order into the WSDL. You must use the [DataMember(order=X)] ordering feature to properly order them since new additions must be placed at the end (so you don't break existing clients). The 'order' is done by group, so that the first versioned group is 1, the second 2, etc.
  2. The XMLSerializer uses the same concept but is ordered like [XMLElement(Order=1)]......[XMLElement(Order=N+1)] with each value N going from 0 on.
  3. If a client is calling in with less information than the service expects, then either the DataContract serializer and the XMLSerializer represent the value of the type as Nullable<T>, so test for this. Express new additional types that support nullable with the question mark (ex: [DataMember(order=x)] public int? age; )
  4. Also note the benefits of IExtensibleDataObject, XMLAnyElement, and XMLIgnore.

kick it on DotNetKicks.com
Wednesday, June 14, 2006 12:31:33 PM (Central Standard Time, UTC-06:00)  #    Comments [1] - Trackback
Computing
Tracked by:
http://freewebs.com/aspxfaq/09/sitemap16.html [Pingback]
http://freewebs.com/toltom/07/sitemap4.html [Pingback]
http://freewebs.com/toltom/04/goldenpalace.html [Pingback]
http://freewebs.com/toltom/00/sitemap9.html [Pingback]
http://freewebs.com/toltom/13/bank-of-america-savings-accounts.html [Pingback]
"http://kevruublog.tripod.com/164.html" (http://kevruublog.tripod.com/164.html) [Pingback]
"http://kevruublog.tripod.com/133.html" (http://kevruublog.tripod.com/133.html) [Pingback]
"http://zoedfw.org/sitemap5.html" (http://zoedfw.org/sitemap5.html) [Pingback]
"http://hzwu9e.org/reverse-411.html" (http://hzwu9e.org/reverse-411.html) [Pingback]
"http://topslots.nl.eu.org/04/sitemap5.html" (http://topslots.nl.eu.org/04/sitem... [Pingback]
"http://freewebs.com/amexa/19/indianapolis-restaurants.html" (http://freewebs.co... [Pingback]
"http://freewebs.com/amexa/28/manheim-auto-auction.html" (http://freewebs.com/am... [Pingback]
"http://freewebs.com/amexa/49/index.html" (http://freewebs.com/amexa/49/index.ht... [Pingback]
"http://pinofranc.homestead.com/01/marauder-millersv-edu.html" (http://pinofranc... [Pingback]
"http://pinofranc.homestead.com/04/aol-internet-services.html" (http://pinofranc... [Pingback]
"http://pinofranc.homestead.com/01/alcohol-abuse.html" (http://pinofranc.homeste... [Pingback]
"http://kfpye-xxx.com/free-blowjob-thumbs.html" (http://kfpye-xxx.com/free-blowj... [Pingback]
"http://rxfac-www.com/dripping-wet-cunt.html" (http://rxfac-www.com/dripping-wet... [Pingback]
"http://nazlyynews.tripod.com/95.html" (http://nazlyynews.tripod.com/95.html) [Pingback]
"http://zelkuunews.tripod.com/133.html" (http://zelkuunews.tripod.com/133.html) [Pingback]
"http://zunvoonews.angelfire.com/171.html" (http://zunvoonews.angelfire.com/171.... [Pingback]
"http://iauci-ooo.com/glamor-girls.html" (http://iauci-ooo.com/glamor-girls.html... [Pingback]
"http://talpeenews.tripod.com/14.html" (http://talpeenews.tripod.com/14.html) [Pingback]
"http://sncjr-hhh.com/vegeta-and-bulma-hentai.html" (http://sncjr-hhh.com/vegeta... [Pingback]
"http://fhg6w-xxx.biz/youngerbabes.html" (http://fhg6w-xxx.biz/youngerbabes.html... [Pingback]
"http://x8jji-www.biz/orgasm-vids.html" (http://x8jji-www.biz/orgasm-vids.html) [Pingback]
"http://oqwos-eee.com/russian-fuck.html" (http://oqwos-eee.com/russian-fuck.html... [Pingback]
"http://freewebs.com/lcddlp/05/atlanta-georgia.html" (http://freewebs.com/lcddlp... [Pingback]
"http://freewebs.com/amexa/08/sitemap16.html" (http://freewebs.com/amexa/08/site... [Pingback]
"http://freewebs.com/tferma/15/best-selling-christian-books.html" (http://freewe... [Pingback]
"http://freewebs.com/tiltak/09/chaparral.html" (http://freewebs.com/tiltak/09/ch... [Pingback]
"http://freewebs.com/tiltak/04/cushions.html" (http://freewebs.com/tiltak/04/cus... [Pingback]
"http://iyhzn-rrr.com/best-fuck.html" (http://iyhzn-rrr.com/best-fuck.html) [Pingback]
"http://unicakomblog.ilbello.com/002-blog.html" (http://unicakomblog.ilbello.com... [Pingback]
"http://ramambo.nl.eu.org/03/google-copm.html" (http://ramambo.nl.eu.org/03/goog... [Pingback]
"http://harum.nl.eu.org/sunset-beach.html" (http://harum.nl.eu.org/sunset-beach.... [Pingback]
"http://ramambo.nl.eu.org/how-to-lose-a-guy-in-10-days-soundtrack.html" (http://... [Pingback]
"http://wevcjxy.biz/boone-nc.html" (http://wevcjxy.biz/boone-nc.html) [Pingback]
"http://voretom.nl.eu.org/black-clits.html" (http://voretom.nl.eu.org/black-clit... [Pingback]
"http://yermena.nl.eu.org/resume-writing.html" (http://yermena.nl.eu.org/resume-... [Pingback]
"http://homcnla.com/naked-asian-chicks.html" (http://homcnla.com/naked-asian-chi... [Pingback]
"http://cm8utr4.biz/hannaanderson.html" (http://cm8utr4.biz/hannaanderson.html) [Pingback]
"http://freewebs.com/gabeganews/4.html" (http://freewebs.com/gabeganews/4.html) [Pingback]
"http://plxguhg.biz/greek-newspapers.html" (http://plxguhg.biz/greek-newspapers.... [Pingback]
"http://obgbtzr.com/lite-erotica.html" (http://obgbtzr.com/lite-erotica.html) [Pingback]
"http://tosi0iq.biz/nolan-helmets.html" (http://tosi0iq.biz/nolan-helmets.html) [Pingback]
"http://zuro--blog.nl.eu.org/bbs-teen-board.html" (http://zuro--blog.nl.eu.org/b... [Pingback]
"http://nasferablog.netfirms.com/401.html" (http://nasferablog.netfirms.com/401.... [Pingback]
"http://nt0poev.biz/intel-com.html" (http://nt0poev.biz/intel-com.html) [Pingback]
"http://nasferablog.netfirms.com/29.html" (http://nasferablog.netfirms.com/29.ht... [Pingback]
"http://nuo--kom.nl.eu.org/huge-boobs.html" (http://nuo--kom.nl.eu.org/huge-boob... [Pingback]
"http://viuqnvu.biz/teen-swimsuit.html" (http://viuqnvu.biz/teen-swimsuit.html) [Pingback]
"http://msve--lono.nl.eu.org/kellyblue-book.html" (http://msve--lono.nl.eu.org/k... [Pingback]
"http://xrxgvm0.biz/john-beck.html" (http://xrxgvm0.biz/john-beck.html) [Pingback]
"http://nasferablog.netfirms.com/271.html" (http://nasferablog.netfirms.com/271.... [Pingback]
"http://jmqp7tr.biz/wahcovia.html" (http://jmqp7tr.biz/wahcovia.html) [Pingback]
"http://wwad6lf.biz/unitedairliens.html" (http://wwad6lf.biz/unitedairliens.html... [Pingback]
"http://derfoblog.ifrance.com/sitemap6.html" (http://derfoblog.ifrance.com/sitem... [Pingback]
"http://freewebs.com/sruone/aramaic.html" (http://freewebs.com/sruone/aramaic.ht... [Pingback]
"http://freewebs.com/sruone/sitemap47.html" (http://freewebs.com/sruone/sitemap4... [Pingback]
"http://kipoertaf.homestead.com/118.html" (http://kipoertaf.homestead.com/118.ht... [Pingback]
"http://mrwqmcw.info/girl-facial.html" (http://mrwqmcw.info/girl-facial.html) [Pingback]
"http://freewebs.com/vuter/12/bank-ofa-merica.html" (http://freewebs.com/vuter/1... [Pingback]
"http://vuter.homestead.com/01/george-mason-athletics.html" (http://vuter.homest... [Pingback]
"http://freewebs.com/vuter/16/sitemap12.html" (http://freewebs.com/vuter/16/site... [Pingback]
"http://euter.homestead.com/01/david-allan-coe.html" (http://euter.homestead.com... [Pingback]
"http://freewebs.com/datingblogger/277.html" (http://freewebs.com/datingblogger/... [Pingback]
"http://freewebs.com/datingblogger/628.html" (http://freewebs.com/datingblogger/... [Pingback]
"http://fasxen.netfirms.com/0.html" (http://fasxen.netfirms.com/0.html) [Pingback]

Computers Blogs - Blog Top Sites

Archive
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 128
Themes
Pick a theme:
All Content © 2009, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)