BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in WS, web services

 
 
Page 19081 of 21350

Default values and PSVI`s

Blogger : steve maines blog
All posts : All posts by steve maines blog
Category : WS, web services
Blogged date : 2005 Apr 03

Kirk Evans has an interesting read about the wisdom (or lack thereof) of relying on post schema validation infosets (PSVI`s) in web service contracts.

Let me attempt to summarize Kirk`s article: XSD lets you define default values for optional attributes in schema, much in the same way databases let you define default values columns. When you validate an instance document against such a schema, these defaults get magically inserted into the PSVI, which now contains additional information (the defaults) that was not originally specified in the document. However, in order to get a PSVI the consumer of the document needs to do schema validation, which it may or may not actually be doing. Since there`s no for the other side to actually do schema validation, relying on information contained only in the PSVI leads to interop problems. As such, it`s better to be explicit and not rely on PSVI`s to provide default values for optional things.

I think it`s pretty clear that relying on PSVI`s adds another layer of coupling to the system. If you use them, it`s not enough for a client to recieve your document -- they now have to explicitly validate that document against a schema you provide in order to construct a PSVI both sides can agree on. However, this additional step would be unnecessary if the both sides were explicit about the contents of the message.

If you can reduce coupling by being explicit, why wouldn`t you


Read comments or post a reply to : Default values and PSVI`s
Page 19081 of 21350

Newest posts
 

    Email TopXML