Web Services and Postel's Law

May 20, 2005

A recent discussion made me wonder why we insist to treat Web services in a way that ignores Postel’s Law. This is the name a statement originally made under the heading “Robustness Principle” in RFC 793 (hat tip to Mark Pilgrim) goes by:

TCP implementations will follow a general principle of robustness: be conservative in what you do, be liberal in what you accept from others.

This shouldn’t be any different in a Web services scenario, where instead XML messages are received with the expectation to conform to a schema defined in some description language (usually W3C XML Schema + WSDL):

I’m not sure whether this implies that a more rigid schema language (such as W3C XSD) should be applied and validated against on the sending side, while a more flexible one such as Schematron might be more appropriate on the receiving side. In any case, the level of conservatism introduced by generating and compiling receiver-side code from the schema - at least in the way we do it today - reduces robustness.

A possibly great way - taken in Microsoft’s Indigo to a certain degree, if I understand some earlier samples correctly - would be to generate code only for the subset that is actually used, e.g. specifying what to generate code for by using XPath expressions. Is there an XML binding for Java that works this way? I couldn’t find one within a few minutes.

About

This page contains a single entry from Stefan Tilkov's Random Stuff posted on May 20, 2005 10:14 PM. The previous post in this blog was How to Build Emacs on OS X Tiger and Above. The next post in this blog is Web Services Standards. Many more can be found on the main index page or by looking through the archives.

Comments

somehow related is :

http://incubator.apache.org/servicemix/servicemix-bean.html

for example the XPath annotation.

http://fisheye6.cenqua.com/browse/~raw,r=506389/servicemix/tags/servicemix-3.1/deployables/serviceengines/servicemix-bean/src/test/java/org/apache/servicemix/bean/beans/PlainBean.java

… takes the interesting parts of the message and ignores the rest …

Posted by: yadnem at March 29, 2007 12:31 PM | link