<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>subbu.org &#187; soa</title>
	<atom:link href="http://www.subbu.org/blog/category/soa/feed" rel="self" type="application/rss+xml" />
	<link>http://www.subbu.org</link>
	<description>HTTP, REST and some Cycling</description>
	<lastBuildDate>Tue, 13 Jul 2010 00:09:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Service API Design &#8211; Context vs State</title>
		<link>http://www.subbu.org/blog/2006/12/service-api-design-context-vs-state</link>
		<comments>http://www.subbu.org/blog/2006/12/service-api-design-context-vs-state#comments</comments>
		<pubDate>Sun, 24 Dec 2006 20:45:26 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2006/12/service-api-design-context-vs-state/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>Carlos Perez at <a href="http://www.manageability.org">manageability.org</a> posted an interesting discussion on <a href="http://www.manageability.org/blog/stuff/object-oriented-interaction-harmful">OO-styled interactions</a>, and I can&#8217;t agree more.</p>
<p>It is very common to find most people listing <em>stateless</em>ness as one of the key principles of service API design. Statelessness is an overloaded term. To my experience, when someone says that a service is stateful, he/she usually means that the service <em>maintains</em> some internal state. We can argue all day long on whether maintaing state is good or bad &#8211; the answer usually depends on what the service is doing. In most cases, whether a service needs to maintain state or not is a service implementation choice &#8211; service users do not need to know or care about it.</p>
<p><span id="more-82"></span></p>
<p>From the client&#8217;s point of view, statefulness of a service usually implies that interactions with the service need to happen in some sequence to be meaningful, i.e. the client maintains some context with the service it is interacting with. Context is what a client should care about &#8211; not about whether the service is stateful or stateless.</p>
<p>Shared context makes service invocation interesting and meaningful. The service needs to define the context which may then be updated by the service or the client, and may even include references to any internal state maintained by the service itself. Services that don&#8217;t require any client-managed context are usually general-purpose utility services. Most usuful services need to depend on some share context to be useful. Context is what makes it possible to break a task into sub-tasks and let the client invoke sub-tasks in some defined sequence.</p>
<p>Some designers may prefer combining shared context with the inputs and outputs of service invocations. IMO, keeping the context separate from the data being processed and returned makes the service interface definition lot more cleaner, easier to understand, and extend. One problem with most programming models used for implementing services is that they don&#8217;t provide for shared context.  For instance, take stateful EJBs. They are becoming extinct (rightly so) because they emphasize on the stateful nature and not on the shared context. With stateful EJBs, sharing the context meant that the client held onto the bean till the work is done. That is not the same as the shared context. Unfortunately, later layers like Java web services extended the same notion, and don&#8217;t provide for shared context within the supported programming models. You can easily bind a web service implementation to a class or a EJB, but you need to invent your own mechanisms for supporting shared context. Then there is the <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=ws-caf">Web Servces Composite Application Framework</a>, but I don&#8217;t think that is what service developers really want to worry about.</p>
<p>This also reminds me of <a href="http://www.w3.org/2001/03/WSWS-popa/paper29">The Need for Shared Context</a> by Anne Thomas Manes, which argued for the need for defining a shared context.</p>
<p>Another harmful aspect OO-styled interactions that Carlos did not mention is idempotency. One of the problems with object-oriented  development is that it is difficult to tell whether a given service invocation is idempotent or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2006/12/service-api-design-context-vs-state/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Case for UDDI Registries</title>
		<link>http://www.subbu.org/blog/2006/03/a-case-for-uddi-registries</link>
		<comments>http://www.subbu.org/blog/2006/03/a-case-for-uddi-registries#comments</comments>
		<pubDate>Sun, 19 Mar 2006 18:58:28 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2006/03/a-case-for-uddi-registries/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>
Here is a realistic application of UDDI registries. This one is not<br />
imaginary, and is not driven by a need to somehow use a registry to get<br />
SOA qualified. Moreover, you may not find this use case prominently<br />
anymore in white papers and brochures on UDDI registries.</p>
<p><span id="more-61"></span></p>
<p>
In the past, I have blogged about the<br />
<a href="http://www.subbu.org/weblogs/welcome/2005/07/soa_a_shot_in_t_1.html"><br />
hype around registries, repositories and SOA</a>, and I have been<br />
<a href="http://blogs.ittoolbox.com/eai/applications/archives/005237.asp"><br />
quoted</a> for that. But now, I am about to describe a use case for which<br />
using UDDI registry makes sense. This is one of the few use cases where<br />
finding, and consuming business services at runtime (and not design time)<br />
is possible. In this case, users search for services, select services, and<br />
start using them almost immediately. Please be warned that this use case<br />
does not involve any of the following use cases that registries have been<br />
touted for:</p>
<ul>
<li>Dynamic routing of service requests</li>
<li>Enforcement of policies</li>
<li>Controlling the integrity of services published</li>
<li>Governance</li>
</ul>
<p>
My use case is more basic than all of the above. Here it is.</p>
<ul>
<li>A developer writes a an app with a web-based UI, and deploys it.</li>
<li>A user wants to find and it and use it.</li>
</ul>
<p>
In this use case, the app is a portlet, and the user is interested in<br />
finding portlets based on some metadata, and using them. The user is not<br />
interested in understanding the interfaces for services, or their<br />
semantics, or designing software to use services. The user may be a<br />
typical web surfer, or an administrator creating portals. Here is how UDDI<br />
helps solve this use case:</p>
<ul>
<li>The runtime hosting the app publishes the app as business service in a<br />
UDDI registry. Note that the app is not a web service.</li>
<li>User searches against the registry using some high-level UI. The UI<br />
presents portlets.</li>
<li>When the user finds a portlet that he/she is looking for, the user<br />
will aggregate it into a portal page, and start using it right away.</li>
</ul>
<p>
As I have argued<br />
<a href="http://www.subbu.org/weblogs/welcome/2004/11/sifting_through.html"><br />
previously</a> on this blog, most typical service clients can not take<br />
advantage of dynamic discovery of web services through a UDDI registry.<br />
The reason is that most web services are tailored to to specific business<br />
use cases, and a developer needs to know about the service at design time.<br />
The developer will have to look up the WSDL, the schema for messages, and<br />
some other documentation to understand the semantic meaning of each and<br />
every detail of the service.</p>
<p>
However, in my use case, the services and the clients are generic, and in<br />
most cases, users can use a service as soon as finding one. Here is how:</p>
<ul>
<li>The business service in my use case is a portlet. A portlet is usually<br />
an app encapsulating some UI, business logic and data.</li>
<li>The runtime for portlets (a.k.a portlet producer) supports<br />
<a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsrp"><br />
WSRP</a>, and can offer portlets over web services to any client<br />
supporting WSRP.</li>
<li>The producer publishes each portlet as a business service in a UDDI<br />
registry. The producer can do this behind the scenes without requiring the<br />
portlet developer/deployer understand UDDI.</li>
<li>The client is a portal or an application (a.k.a. consumer) that can<br />
aggregate portlets into web pages. The client implements WSRP.</li>
<li>When a user searches for portlets, the consumer searches the registry<br />
for matching business services, and presents the results as portlets.</li>
<li>The user aggregates portlets found into web pages.</li>
</ul>
<p>
In this use case, both the service and client are generic, and that is the<br />
key to publishing, finding, and using services dynamically at runtime.</p>
<p>
I must say that I&#8217;m quite excited about supporting this use for the next<br />
release of<br />
<a href="http://www.bea.com/framework.jsp?CNT=index.htm&amp;FP=/content/products/weblogic/portal"><br />
WebLogic Portal</a> due to be released in a couple of months. Prior to<br />
supporting this use case, finding portlets was not very easy. Let&#8217;s say,<br />
portlets are hosted in a number of producers. Each producer offers a<br />
WSRP-compliant WSDL, and one of the operations in the WSDL can be used to<br />
fetch a list of portlets available on a producer. To search for portlets,<br />
the user will have to go through this list from each producer. This can be<br />
tedious if the number of portlets is large. UDDI helps simplify this use<br />
case. By mapping portlets into business services, and publishing them into<br />
a registry, the problem is much simplified. Instead of browsing lists of<br />
portlets, users can type in keywords or other criteria to search for<br />
portlets. To help this use case, the WSRP TC released a<br />
<a href="http://www.oasis-open.org/committees/wsrp/specifications/version1/wsrp-pfb-abstract-model-1_0.pdf"><br />
technical note</a> that describes a mapping portlets and portlet producers<br />
into services that can be published into<br />
<a href="http://www.oasis-open.org/committees/wsrp/specifications/version1/wsrp-pfb-uddi-tn-1.0.pdf"><br />
UDDI</a> or<br />
<a href="http://www.oasis-open.org/committees/wsrp/specifications/version1/wsrp-pfb-ebxml-tn-1.0.pdf"><br />
ebXML</a> registries.&nbsp; </p>
<p>
There are few issues that may stand in the way of using portlets found in<br />
a registry immediately. In some cases, the user may not have enough<br />
privileges to use a portlet. In other cases, the user may require the<br />
assistance of administrators to help meet the security policy requirements<br />
of portlet producers. But once these infrastructure issues have been<br />
related, finding and using portlets is as easy is getting some plumbing<br />
help via yellow pages.</p>
<p>
Despite this simplicity, I don&#8217;t imagine emergence of global portlet<br />
registries. The main reason is that a portlet registry makes sense when<br />
there are a large number of remote portlets deployed, and typically such<br />
deployments may be limited to large enterprises. Secondly, there are still<br />
issues around security and other quality of service, and these require<br />
out-of-band negotiation in most cases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2006/03/a-case-for-uddi-registries/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SOA Definition</title>
		<link>http://www.subbu.org/blog/2006/01/soa-definition</link>
		<comments>http://www.subbu.org/blog/2006/01/soa-definition#comments</comments>
		<pubDate>Fri, 27 Jan 2006 12:22:57 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2006/01/soa-definition/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>Given the frequent appearance of the word &#8220;SOA&#8221;, I would expect that whoever is &#8220;doing&#8221; and &#8220;preaching&#8221; SOA must know very well what SOA is all about. But it turns out that most people are confused about the &#8220;definition&#8221; of SOA. Check JP Morgenthal&#8217;s <a href="http://www.dmreview.com/article_sub.cfm?articleId=1046478">Enterprise Architecture: The Holistic View: The A in SOA is Architecture</a>. </p>
<p><span id="more-57"></span></p>
<p>So my question is &#8220;what exactly are you doing when you say you are doing SOA?&#8221; Or, are you calling whatever you are already doing as SOA? Hmm. Is that why SOA is now called a strategy and not a technology?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2006/01/soa-definition/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real World Vs. Buzz World</title>
		<link>http://www.subbu.org/blog/2005/12/real-world-vs-buzz-world</link>
		<comments>http://www.subbu.org/blog/2005/12/real-world-vs-buzz-world#comments</comments>
		<pubDate>Sun, 04 Dec 2005 20:22:37 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2005/12/real-world-vs-buzz-world/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>My thoughts after reading a lot of blogs and articles on SOA that appeared this year.</p>
<p><span id="more-53"></span></p>
<h4>Real World</h4>
<div class="note">
<p>XML, XSD, SOAP, WSDL, WS-*, APIs, Platforms, Tools</p>
<p> ===> Seperation of concerns, Granularity, Complexity, Performance </p>
<p> =====> Code</p>
</div>
<h4>Buzz World</h4>
<div class="note">
<p>Service oriented, Loosely-coupled, Dynamic, Coarse-grained, Agile, Efficient, Reuse, Composite, Ecosystems, Symbiosis (yes, some blogger used the last two words recently).  </p>
<p>===> Vapor</p>
<p>======> More vapor</p>
</div>
<p>e-Nough. Let me get back to the real world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2005/12/real-world-vs-buzz-world/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web Services Versioning &#8211; Part 2</title>
		<link>http://www.subbu.org/blog/2005/08/web-services-versioning-part-2</link>
		<comments>http://www.subbu.org/blog/2005/08/web-services-versioning-part-2#comments</comments>
		<pubDate>Sun, 21 Aug 2005 21:18:00 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2005/08/web-services-versioning-part-2/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>Several months ago, I <a href="http://www.subbu.org/weblogs/welcome/2004/12/web_services_ve_1.html" title="Web Services Versioning - Part 1">blogged</a><br />
about versioning of web services. Between then and now, I realized that versioning of web services is a very nebulous topic, and that the problem of versioning could test the motivation of even the most committed web services architect. In this post, I would like to take the next step and discuss some possible ways of versioning web services. In this process, I would like to answer two questions:</p>
<p><span id="more-40"></span></p>
<ul>
<li>How to version the public view of a web serice, i.e. the WSDL?</li>
<li>How to make web service implementations support versioning?</li>
</ul>
<p>Before I get too far in this discussion, let me clarify that in some situations it may be perfectly acceptable to not support previous versions of a web service, i.e. break backwards-compatibility. For instance, between close-knit applications, it is possible to make changes to both the service and its clients at the sime time, and avoid the question of compatibility altogher. On the otherhand, there are cases where the web service and its clients cannot be upgraded at the same time for a variety of reasons. I would argue that the more popular and useful your web services are, the more difficult it would be to make simultaeous upgrades to clients. In a loosely-coupled enterprise, such a big-bang migration should not even be required. For a certain period of time (if not indefitely), the service implementation may be required to support multiple versions of its interface at the same time, just because some of the clients have not chosen to upgrade.</p>
<p>Since web services carry XML messages, it would seem logical that recognizing the version of an incoming message is adequate for building a web service that can support multiple versions of the services it offers. For instance, a web service could accept two kinds of messages, with each message described by a different schema. The problem is then to version those<br />
schemas, e.g. as discussed <a href="http://www.subbu.org/weblogs/welcome/2005/03/versioning_xml.html" title="Versioning XML Schemas">here</a>.</p>
<table class="line-drawing" align="center">
<tr>
<td>
<pre>
|-------------|
----->{Message m1/Schema v1}----->|             |
| Web Service |
----->{Message m2/Schema v2}----->|             |
|-------------|
</pre>
</td>
</tr>
</table>
<p>The web service could, at least in thoery, examine the message, and depending on the version, or the presence/absence of certain elements/attributes in the message, could support multiple versions of the service using the same implementation. For those bothered with versioning, this is the most ideal solution. However, in reality, current web services related standards and tools make it difficult to support such a simplified solution. Firstly, SOAP and WSDL&#8217;s view of web services is more complex than the simplified view above. Secondly, web services programming standards like JAX-RPC (or <a href="http://jcp.org/en/jsr/detail?id=224" title="Java API for XML-Based Web Services">JAX-WS</a> as JAX-RPC is called now as) and <a href="http://jcp.org/en/jsr/detail?id=181" title="Web Services Metadata for the JavaTM Platform">JWS</a> do not consider versioning either.</p>
<h3>WSDL Versioning</h3>
<p>Since WSDL is the de-facto standard for specifying web service interfaces, the first problem to tackle is versioning the WSDL. WSDLs have service bindings, port types, messages and types. Messages are constructed using elements of types, ports specify operations with input/output messages, bindings bind operations to a protocol, and finally services associate bindings to a network address. Therefore, you must start the versioning exercise from the types used in the WSDL, and then extend it to the WSDL level.</p>
<p>Let me start with a simple web service that creates a new employee.</p>
<pre name="code" class="xml">
&lt;definitions targetNamespace="empl:v1"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:v1="empl:v1"
xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/""&gt;
&lt;import location="v1_bindings.wsdl" namespace="empl:v1"/&gt;
&lt;service name="EmplManagerService"&gt;
&lt;port binding="v1:EmplManagerBinding" name="EmplManagerPort"&gt;
&lt;v1:address location="http://noname.org/emplManager/v1"/&gt;
&lt;/port&gt;
&lt;/service&gt;
&lt;/definitions&gt;
</pre>
<p>where the imported file contains the following.</p>
<pre name="code" class="xml">
&lt;wsdl:definitions targetNamespace="empl:v1"
xmlns:v1="empl:v1"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;
&lt;wsdl:types&gt;
&lt;schema targetNamespace="empl:v1"
xmlns:v1="empl:v1"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"&gt;
&lt;xs:complexType name="NameType"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="fName" type="xs:string"/&gt;
&lt;xs:element name="lName" type="xs:string"/&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="AddressType"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="street" type="xs:string"/&gt;
&lt;xs:element name="city" type="xs:string"/&gt;
&lt;xs:element name="zip" type="xs:string"/&gt;
&lt;xs:element name="state" type="xs:string"/&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:complexType name="EmployeeType"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="name" type="v1:NameType"/&gt;
&lt;xs:element name="id" type="xs:string"/&gt;
&lt;xs:element name="homeAddress" type="v1:AddressType"/&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;/schema&gt;
&lt;/wsdl:types&gt;
&lt;wsdl:message name="createEmployee"&gt;
&lt;wsdl:part name="createEmployee" type="v1:EmployeeType"/&gt;
&lt;/wsdl:message&gt;
&lt;wsdl:message name="createEmployeeResponse"&gt;
&lt;wsdl:part name="result" type="xs:string"/&gt;
&lt;/wsdl:message&gt;
&lt;wsdl:portType name="EmplManagerPort"&gt;
&lt;wsdl:operation name="createEmployee"&gt;
&lt;wsdl:input message="v1:createEmployee"/&gt;
&lt;wsdl:output message="v1:createEmployeeResponse"/&gt;
&lt;/wsdl:operation&gt;
&lt;/wsdl:portType&gt;
&lt;wsdl:binding name="EmplManagerBinding" type="v1:EmplManagerPort"&gt;
&lt;wsdl:operation name="createEmployee"&gt;
&lt;wsdl:input&gt;
&lt;soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="literal"/&gt;
&lt;/wsdl:input&gt;
&lt;wsdl:output&gt;
&lt;soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="literal"/&gt;
&lt;/wsdl:output&gt;
&lt;soap:operation soapAction=""/&gt;
&lt;/wsdl:operation&gt;
&lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt;
&lt;/wsdl:binding&gt;
&lt;/wsdl:definitions&gt;
</pre>
<p>Given employee details, this web service creates an employee. In this WSDL, I defined the bindings, messages, and types in another WSDL file. Except for the &#8220;hello world&#8221; kind of web services, I find it convenient to split the WSDL into smaller chunks and wire them up together by using imports.</p>
<p>Extending the example used in my <a href="http://www.subbu.org/weblogs/welcome/2005/03/versioning_xml.html" " title="Versioning XML Schemas">schema versioning</a> post, let us add a country field to the address of the employee. As I discussed in that post, adding a <code>country</code> to the <code>AddressType</code> requires creating a new <code>EmployeeType</code>, and we cannot use schema extensions (i.e. via <code>xs:extension</code>) to add this element. We need to create a new schema and add the <code>country</code> to the <code>AddressType</code> in the new schema with a new namespace URI that reflects the new version. Here is my new schema.</p>
<pre name="code" class="xml">
&lt;xs:schema targetNamespace="empl:v2"
xmlns:v2="empl:v2"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"&gt;
&lt;xs:complexType name="NameType"&gt;
&lt;xs:sequence&gt;
&lt;xs:element name="fName" type="xs:string"/&gt;
&lt;xs:element name="lName" type="xs:string"/&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
<strong>&lt;xs:complexType name="AddressType"&gt;</strong>
&lt;xs:sequence&gt;
&lt;xs:element name="street" type="xs:string"/&gt;
&lt;xs:element name="city" type="xs:string"/&gt;
&lt;xs:element name="zip" type="xs:string"/&gt;
&lt;xs:element name="state" type="xs:string"/&gt;
<strong>&lt;xs:element name="country" type="xs:string" default="US" minOccurs="0" maxOccurs="1"/&gt;</strong>
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
<strong>&lt;xs:complexType name="EmployeeType"&gt;</strong>
&lt;xs:sequence&gt;
&lt;xs:element name="name" type="v2:NameType"/&gt;
&lt;xs:element name="id" type="xs:string"/&gt;
&lt;xs:element name="homeAddress" type="v2:AddressType"/&gt;
&lt;xs:element name="ssn" type="xs:string" minOccurs="0" maxOccurs="1"/&gt;
&lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
&lt;xs:element name="Employee" type="v2:EmployeeType"/&gt;
&lt;/xs:schema&gt;
</pre>
<p>From the WSDL&#8217;s point of view, we also need to define new messages, port types, and bindings, since the same set of messages/port types/bindings cannot be used to carry messages from two different schemas.</p>
<p>Here is the new WSDL.</p>
<pre name="code" class="xml">
&lt;wsdl:definitions targetNamespace="empl:v2"
xmlns:v1="empl:v1"
xmlns:v2="empl:v2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;

&lt;import namespace="empl:v1" location="v1_bindings.wsdl"/&gt;
&lt;import namespace="empl:v2" location="v2_bindings.wsdl"/&gt;

&lt;wsdl:service name="EmplManagerService"&gt;
&lt;wsdl:port name="EmplManagerPort" binding="v1:EmplManagerBinding"&gt;
&lt;soap:address location="http://localhost:7001/emplManager/v1"/&gt;
&lt;/wsdl:port&gt;
<strong>&lt;wsdl:port name="EmplManagerPort_v2" binding="v2:EmplManagerBinding"&gt;</strong>
<strong>&lt;soap:address location="http://localhost:7001/emplManager/v2"/&gt;</strong>
<strong>&lt;/wsdl:port&gt;</strong>
&lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;
</pre>
<p>Here is the imported vs_bindings.wsdl file.</p>
<pre name="code" class="xml">
&lt;definitions targetNamespace="empl:v2"
xmlns:v2="empl:v2"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;
&lt;types&gt;
&lt;!-- snip --&gt;
&lt;/types&gt;
&lt;message name="createEmployee"&gt;
&lt;part name="createEmployee" type="v2:EmployeeType"/&gt;
&lt;/message&gt;
&lt;message name="createEmployeeResponse"&gt;
&lt;part name="result" type="xs:string"/&gt;
&lt;/message&gt;
&lt;portType name="EmplManagerPort"&gt;
&lt;operation name="createEmployee"&gt;
&lt;input message="v2:createEmployee"/&gt;
&lt;output message="v2:createEmployeeResponse"/&gt;
&lt;/operation&gt;
&lt;/portType&gt;
&lt;binding name="EmplManagerBinding" type="v2:EmplManagerPort"&gt;
&lt;operation name="createEmployee"&gt;
&lt;input&gt;
&lt;soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="literal"/&gt;
&lt;/input&gt;
&lt;output&gt;
&lt;soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="literal"/&gt;
&lt;/output&gt;
&lt;soap:operation soapAction=""/&gt;
&lt;/operation&gt;
&lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt;
&lt;/binding&gt;
&lt;/definitions&gt;
</pre>
<p>By choosing to define a new schema for the types for versioning sake, we, in essence, defined a new set of messages, port types, bindings, and a new WSDL port for the versioned operation. At the WSDL level, this is as far as we can get for introducing a new version of a web service. To summarize, the following are the steps for versioning a WSDL.</p>
<ul>
<li>Define new or extended types for changes in types in a new namespace.</li>
<li>Define new messages.</li>
<li>Define new port types and bindings.</li>
<li>Add a new service or new ports to an existing service in the WSDL.</li>
</ul>
<p>For the client, this approach means that, it must choose the WSDL port based on the version it can support.</p>
<table class="line-drawing" align="center">
<tr>
<td>
<pre>
|-------------|
----------|             |
----->{Message m1/Schema v1}----->| Port v1 |             |
----------|             |
| Web Service |
----------|             |
----->{Message m2/Schema v2}----->| Port v2 |             |
----------|             |
|-------------|
</pre>
</td>
</tr>
</table>
<p>Clients supporting the new version will therefore use new ports, and clients using the old version(s) will continue with old ports.</p>
<h3>Implementing Versioned Web Services</h3>
<p>I consider versioning the WSDL the easier part of the problem. Once we decide how to version schma types, the rest of the process is simple to deal with. For the web service provider as well as the client, a more difficult problem is supporting multiple versions at the same type. Moreover, web services programming standards like JAX-RPC and JWS have not matured enough to support versioning of web services yet.</p>
<div class="note">
<p>It is interesting to note that the latest public draft of <a href="http://jcp.org/en/jsr/detail?id=224">JAX-WS 2.0</a> specification does mention in one of the introductory sections that &quot;versioning and evolution of web services&#034; is one of goals of the specification, but the rest of the specification stays silent on this. I will not be surprised if this goal is dropped from the final diaft of this specification.</p>
</div>
<p>Let me now start with the above versioned WSDL. When you generate code from thus WSDL using various WSDL to Java tools, you will essentially get two sets of artifacts, one for each version. For instance, here is a the Java interface generated by Axis 1.2&#8217;s wsdl2java task.</p>
<pre class="brush: java">
public interface EmplManagerService extends javax.xml.rpc.Service {
public java.lang.String getEmplManagerPort_v2Address();

public v2.EmplManagerPort getEmplManagerPort_v2() throws javax.xml.rpc.ServiceException;

public v2.EmplManagerPort getEmplManagerPort_v2(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
public java.lang.String getEmplManagerPortAddress();

public v1.EmplManagerPort getEmplManagerPort() throws javax.xml.rpc.ServiceException;

public v1.EmplManagerPort getEmplManagerPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}
</pre>
<p>This interface has two different sets of methods one for each version. From the WSDL-to-Code translation point of view, this interface is valid, and is to be expected. However, from versioning point of view, the developer implementing this interface will have to deal with supporting two seperate code paths, one for each version, and that makes it supporting versioning more challenging.</p>
<p>For example, take the implementation of <code>v1.EmplManagerPort</code>.</p>
<pre class="brush: java">
public class EmplManagerPortImpl implements v1.EmplManagerPort
{
public java.lang.String createEmployee(v1.EmployeeType createEmployee) throws java.rmi.RemoteException
{
// Validate the employee object

// Create the employee record in a DB

// Return the employee ID
}
}
</pre>
<p>In order to support the new version of the WSDL, you will need to create an implementation of <code>v2.EmplManagerPort</code>.</p>
<pre class="brush: java">
public class EmplManagerPortImpl implements v2.EmplManagerPort
{
public java.lang.String createEmployee(v2.EmployeeType createEmployee) throws java.rmi.RemoteException
{
// <strong>How to implement this?</strong>
}
}
</pre>
<p>The question is how best to create this implementation. One of the most obvious answers is to simply duplicate the code. You may even be able to share some code at a lower level, but code dealing with schema types will have to be duplicated. So, the downside of this approach is maintenance of two versions of the software with different source code. </p>
<table class="line-drawing" align="center">
<tr>
<td>
<pre>
|-------------|
----------|             |
----->{Message m1/Schema v1}----->| Port v1 | Web Service |
----------|             |
--------------
----------|             |
----->{Message m2/Schema v2}----->| Port v2 | Web Service |
----------|             |
|-------------|
</pre>
</td>
</tr>
</table>
<p>Subsequent versioning only worsenss this duplication, and leads to more code maintenance nightmares.</p>
<p>Here are some choices that, though take considerable effort to build, would address versioning given the current state of support in web services standards.</p>
<ul>
<li>Message transformation and Routing</li>
<li>Common layer for version-indepent types and business logic</li>
</ul>
<p>Let me elaborate on these approaches.</p>
<h4>Message Transformation and Routing</h4>
<p>I have explored the idea of transformation of XML documents from one version to another in one of my previous posts on <a href="http://www.subbu.org/weblogs/welcome/2005/03/processing_vers.html" title="Processing Versioned XML Documents">processing versioned XML documents</a>.</p>
<table class="line-drawing" align="center">
<tr>
<td>
<pre>
|-------------|
-------------    |             |
----->{Message m1/Schema v1}----->| Transform |    |             |
-------------    |             |
|          | Web Service |
|          |             |
----->{Message m2/Schema v2}---------------------->|             |
|             |
|-------------|
</pre>
</td>
</tr>
</table>
<p>The core idea is to somehow transform v1 messages to conform to the v2 schema, and then route messages targeted to v1 port(s) to corresponding v2 port(s), such that the same code path can be used for both versions. For such a transformation and routing, you may need some extra plumbing not often found in most web service stacks. In these web service stacks, such message transformation can only happen before a message reaches the server, but not afterwards. For example, in JAX-RPC based web service stacks, the first entry point for programmatic manipulation of an incoming SOAP message is a JAX-RPC handler. But in JAX-RPC, handlers are associated with specific ports, and you cannot change the message after the web services runtime already bound the message to a given port. Doing so would most likely cause subsequent message processing to fail.</p>
<p>One possibility is to build a proxy server (or use a SOAP intermediary) to transform SOAP messages to conform to the latest version, and route the messages targeted to v1 ports to corresponding v2 ports. Most products offering web services management frameworks/tools provide some degree of transformation and routing capabilities. It would be interesting to see if such products can be put to use to solve web services versioning.</p>
<h4>Common Data Abstraction Layer</h4>
<p>Another possibility is do the transformation within the application implementing the web service.</p>
<table class="line-drawing" align="center">
<tr>
<td>
<pre>
|-------------------------------------------|
----------|     -------------                         |
----->{Message m1/Schema v1}----->| Port v1 |---> | Transform |                         |
----------|     -------------     ------------------  |
|            |--------> | Business Logic |  |
----------|     -------------     ------------------  |
----->{Message m2/Schema v2}----->| Port v2 |---> | Transform |                         |
----------|     -------------                         |
|-------------------------------------------|
</pre>
</td>
</tr>
</table>
<p>In this case, the core business logic of the web service needs to be implemented in a version independent manner. Preferrably, this core layer should not also depend on any code generated using the WSDL of a particular version. For each version, you need to translate the incoming request into API calls of this core layer. In this case, versioning related changes can be limited to the layer that does this transformation. </p>
<p>In the case of the above sample web service, the first step is to build (or refactor from the existing version) an <code>EmplManager</code> component that can create an employ.</p>
<pre class="brush: java">
public class EmplManager
{
public String createEmployee(Employee employee) throws EmplManagerException
{
// Validate the employee object

// Create the employee record in a DB

// Return the employee ID
}
}
</pre>
<p>Here, the <code>Employee</code> object must semantically match the latest version of the <code>EmployeeType</code> used in the schema, so that <code>Employee</code> objects can be created from both <code>v1.EmployeeType</code> and <code>v2.EmployeeType</code> objects.</p>
<pre class="brush: java">
public class EmplManagerPortImpl implements v2.EmplManagerPort
{
public java.lang.String createEmployee(v2.EmployeeType createEmployee) throws java.rmi.RemoteException
{
// Create EmployeeType
Employee empl = new Employee();
// Set data
empl.setFirstName(createEmployee.getFName());
...

return emplManager.createEmployee(empl);
}
}
</pre>
<p>Similar code could be used to implement the <code>v1.EmplManagerPort</code> interface. The only difference between these two would be the new optional elements added in the v2 schema.</p>
<p>Although cumbersome to implement, the advantage of this approach is that you can maintain compatible versions of a web service without duplicating core business logic.</p>
<p>Yet another possibility is to implement the business logic using low-level APIs like SAAJ and DOM. Since SAAJ and DOM are not typed, you can use the same processing code to process documents of compatible versions. Unfortunately, most web service stacks don&#8217;t make it easy to generate SOAP response messages at this low level. For example, in the case of JAX-RPC, handlers can be used to process request and response messages but can replace the need for port components that use schema-generated types.</p>
<p>Similar approaches could be used on the client-side, and so I will skip repeating these for the client implementation.</p>
<h3>Lessons Learned</h3>
<p>As I remarked at the beginning of this post, versioning is a very nebulous topic. One of the basic issue is specifying what a version is. As in my previous posts on this topic, in this post, I assumed that only compatible changes are allowed in the schema as well as WSDL. But what is a compatible version? If you change the name of an element or attribute, is it still a compatible change? I think the answer varies on a case by case basis. A change considered compatible on one case may turn to be incomatible in some other case. I think the key point is semantics. Even when an element or an attribute is changed in the new version of a schema, the change may not alter the sematics. The change may enhance an existing semantic, but not alter it. Such a change is compatible.</p>
<p>Here are some guidelines that may help minimize the impact of versioning in an implementation.</p>
<ul>
<li><strong>Keep changes compatible</strong>: This is the basic versioning rule. You may have reasons for incompatible versions, but the consequences of incompatible changes are usually painful.</li>
<li><strong>Avoid using generated types:</strong> Avoid using WSDL/schema generated classes/interfaces in your business logic. Instead design your core business logic to use simple Java objects (a.k.a. POJOs). This would keep the core part of your implementation independent of version-specific code generated by web services toolkits.</li>
<li><strong>WSDL first</strong>: Although most toolkits encourage Java-first approach to designing web services, I find it useful to start with WSDL and schema first, mainly because it allows me to focus on the external view of the web service without worrying about how it is implemented.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2005/08/web-services-versioning-part-2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is Everything Built Before SOA WASTE?</title>
		<link>http://www.subbu.org/blog/2005/07/is-everything-built-before-soa-waste</link>
		<comments>http://www.subbu.org/blog/2005/07/is-everything-built-before-soa-waste#comments</comments>
		<pubDate>Mon, 25 Jul 2005 06:23:53 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2005/07/is-everything-built-before-soa-waste/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>The JDJ newletter dated 07/21/2005 contains an ad that starts with the presumption that everything built before SOA cannot easily be integrated into the new SOA world, and someone is there is to help us. If not FUD, what is this?</p>
<p><span id="more-37"></span></p>
<p>Here is the complete text of this advertisement.</p>
<div class="note">
<p><em><strong>Is everything built before SOA WASTE?</strong></em></p>
<p><em>While delaying SOA everything you create will not be native services and may need to be re-tooled for conversion. Quickly create, manage and monitor web services &amp; Java services. Test a sample project to see how easy it is to capitalize on SOA!</em></p>
</div>
<p>I think the second word is supposed to read &#8220;deploying&#8221; but this is a verbatim of the text appeared in the JDJ newsletter. When you click on to this ad, it takes you to this <a href="http://www.skywaysoftware.com/products.htm">page</a>. This ad is for a group of products for building and managing services using some GUI tools. The products may very well be innovative for solving some related problems, but the text of the ad itself is very misleading and the only purpose seems to cause some FUD. Just to be clear, I have nothing against the products or this company, and my comments are limited to just the contents of the ad. </p>
<p>This ad raises a rather misleading question. What was it like before SOA? A quick google search points to a very common definition of SOA as &#034;an architectural style whose goal is to achieve loose coupling among interacting software agents&#034;. The key point here is loose-coupling of sub-systems involved.
<p>Most architects of enterprise software systems would definitely agree that loose-coupling is desirable for a variety of reasons. As an architectural style, SOA is just one piece of a puzzle. Loose-coupling is just one of the desired qualities. It is not the whole.</p>
<p>Now the quiz question. Can you untangle all your tightly coupled apps to make them SOA-friendly? Still want clues?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2005/07/is-everything-built-before-soa-waste/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SOA &#8211; A Shot in the Arm for Registry Fans?</title>
		<link>http://www.subbu.org/blog/2005/07/soa-a-shot-in-the-arm-for-registry-fans</link>
		<comments>http://www.subbu.org/blog/2005/07/soa-a-shot-in-the-arm-for-registry-fans#comments</comments>
		<pubDate>Sat, 09 Jul 2005 21:42:15 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2005/07/soa-a-shot-in-the-arm-for-registry-fans/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>It seems so. Registry fans are just beginning to get the attention they have been hoping for the last few years. As I was catching up with my email, I just came  this article titled &#8220;<a href="http://www.adtmag.com/article.asp?id=11427">Registry + Repository = SOA Platform</a>&#8220;. Very interesting! A registry and repository to build and deploy SOA!</p>
<p><span id="more-36"></span></p>
<p>Let me try to make sense of the contribution of registries to SOA first. The author of this article quotes that &#8220;registries hold references to things&#8221;. That is right. Registries hold metadata of services and other interesting things. But this article fails to say why and how it helps SOA. As I discussed <a href="http://www.subbu.org/weblogs/welcome/2004/11/sifting_through.html">here</a>, in most applications, registry is a development-time component, but not a runtime component. Developers intending to make use of web services can search repositories to find services that match certain classification criteria. Once a service is found, the next step is to build a client application, which usually starts with some codegen tool to generate interfaces/classes that proxy the service, and then programming to those interfaces/classes. This is the old-fashioned way of wiring up distributed applications. The only exception is when the client already knows how to use the service, and is consulting the registry only to know the where-abouts of the service. </p>
<p>So registries can be useful when the client wants to be directed to an instance of a service based on some runtime criteria such as QoS, fail over etc. Some web services management (WSM) tools advertise such &#8220;dynamic routing&#8221; as one of the main features of their products. Such tools can indeed take the help of registries for looking up for services (including their WSDL). The difference between the <em>old-fashioned</em> style of fail-over and load-balancing and the <em>new age</em> dynamic routing is the ownership of routing. For instance, in the HTTP world, proxy servers do the routing. In most RPC style applications, client consults some look-up service (such as a JNDI or a naming service) to do the routing. In this context, I don&#8217;t see much difference between these styles. The role of registries in this context is not as phenomenal as the author of this article is hoping for. Moreover, WSM-controlled routing has its disadvantages. I will post more about these limitations in a future post.</p>
<p>The second part of the equation is repositories. The author quotes that &#8220;repositories hold things&#8221;. But what things? I have read this article a few times to understand what he meant by a repository. Is he talking about an XML repository used as a general purpose database? Or is he is referring to a repository for service metadata? Although the article is not very clear, my hunch is that it is the latter. But how does it contribute to SOA? Hmmm.</p>
<p>Looks like my fad-analyzer is not working very well. Time to upgrade?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2005/07/soa-a-shot-in-the-arm-for-registry-fans/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web Services Versioning &#8211; Part 1</title>
		<link>http://www.subbu.org/blog/2004/12/web-services-versioning-part-1</link>
		<comments>http://www.subbu.org/blog/2004/12/web-services-versioning-part-1#comments</comments>
		<pubDate>Mon, 06 Dec 2004 21:50:17 +0000</pubDate>
		<dc:creator>Subbu Allamaraju</dc:creator>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://wp.subbu.org/2004/12/web-services-versioning-part-1/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p></p><p>Managing change and versioning of web services can be hard. Although based on loose coupling and extensibility concepts, when it comes to change, web services are not far from older supposedly not-so-loosely coupled RPC-style technologies.</p>
<p>Most changes have good intentions &#8211; either they fix something broken, or try to enhance the service by adding new features. However, except in the most ideal cases, changes are disruptive. As <a href="http://davidbau.com">David Bau</a> explains in his &quot;<a href="http://davidbau.com/archives/2003/11/21/no_theory_of_compatibility.html">morning<br />
after</a>&quot; scenario, the need for compatibility can scuttle most plans for change. It is not always easy to foresee changes and future-proof the design, but eventually, we all get tasked to make changes. </p>
<p><span id="more-15"></span></p>
<p>Compatibility is one of the painful aspects of changes. <a href="http://www.pacificspirit.com/blog/">Dave Orchard</a> gives an exhaustive overview of extensibility and versioning scenarios for XML schemas in his &quot;<a href="http://www.xml.com/pub/a/2004/10/27/extend.html">Extensibility,  XML Vocabularies, and XML Schema</a>&quot;, and this post (and the following) are partly motivated by this paper. In this post, I would like to jot down some of my thoughts on versioning of web services. My objective is to set some constraints for the kinds of changes allowed, and then think of how to go about making changes under those<br />
constraints.</p>
<p>Before making changes to any web service, it is important to discuss and understand the impact of a change. This impact can best be discussed in terms of compatibility. Essentially, there are two kinds of compatibility, viz. backwards compatibility, and forwards compatibility. Depending on how service and client instances are deployed, one or both may be important.</p>
<p>Backwards compatibility ensures that older clients need not be <em>upgraded</em> to use an instance of the modified service. That is, when you upgrade your service instance to offer the latest and the greatest service interface, your clients must be able to ignore that fact and continue to use the service as though nothing changed. </p>
<p>On the other hand, forwards compatibility guarantees that new clients need not be <em>downgraded</em> to work with an old service. That is, when you deploy a new client that conforms to the modified web service interface, it should be able to work with old web service instances without having to downgrade. </p>
<p>Whether your goal is to guarantee backwards compatibility, or both backwards and forwards compatibility depends on how many instances of the service are deployed currently. If there are &quot;n&quot; clients interacting with just one instance of the service, backwards compatibility alone may be sufficient. But if there are &quot;n&quot; clients interacting with &quot;m&quot; instances implementing the service, forwards compatibility becomes an issue. This is because, of those &quot;n&quot; clients, some clients may be using instances offering the old service, some others may be using instances offering the new service, while the rest may be using both.&nbsp; </p>
<p>So, here is our first constraint:</p>
<div class="hint">Constraint 1: Changes must guarantee backwards compatibility and possibly forwards compatibility.</div>
<p>Note that I don&#8217;t include the possibility of simultaneous upgrades in this discussion. Simultaneous upgrades are not always practical, and can be disruptive when attempted. Moreover, the whole idea of loose coupling goes against simultaneous upgrades. Why should a client/service upgrade just because the service/client at the other  end of the wire upgraded? This may be a reasonable requirement when the software is monolithic, but not when it is loosely coupled. Check <a href="http://webpages.charter.net/chrisfer/blog.html">Christopher Ferris</a>&#8217;s &quot;<a href="http://webpages.charter.net/chrisfer/2004/11/loose-coupling-and-wsdl-versioning.html">Loose<br />
Coupling and WSDL Versioning</a>&quot; for some arguments on this point. So, the second constraint is:</p>
<div class="hint">Constraint 2: Service&nbsp; instances and their clients should not be forced to upgrade simultaneously.</div>
<p>
Any change that breaks backwards or forwards compatibility is an incompatible change. Incompatible changes are bad, and include:</p>
<ol type="a">
<li>Removing an operation from a WSDL port. This breaks both backwards and forwards compatibility, and forces simultaneous upgrades of clients with service instances.</li>
<li>Replacing an input or output message type with a different message type for the same operation in a WSDL port. This kind of change also breaks both backwards and forwards compatibility.</li>
<li>Adding new required elements to existing messages. </li>
</ol>
<p>
Compatible changes include</p>
<ol type="a">
<li>Adding optional elements or attributes to existing messages.</li>
<li>Adding new operations to an existing WSDL port.</li>
</ol>
<p>
There is one additional detail to consider, and this could be more painful to the folks making changes than anyone<br />
else. Assume that you have the following piece of code at the service end prior to making the change:</p>
<div class="code-snippet">
<pre>   public ResponseMessage doSomething(RequestMessage requestMessage)
// Do something
return responseMessage;
}</pre>
</div>
<p>
After the change, the service implementation might end up looking like the following:</p>
<div class="code-snippet">
<pre>   public ResponseMessage doSomething(RequestMessage requestMessage)
// Do something
return responseMessage;
}

public ResponseMessage1 doSomething1(RequestMessage1 requestMessage)
// Do something better
return responseMessage1;
}
</pre>
</div>
<p>
You could possibly refactor this to share some common logic, but there are two pieces of code to deal with. </p>
<p>
The client may have to follow a similar code pattern as well.</p>
<div class="code-snippet">
<pre>      // if service is old
...
// dispatch the old request
...
// else if the service is the &quot;better&quot; version
...
// dispatch the new request
...
</pre>
</div>
<p>
At first, this option may not look so bad, but this kind of code can be very difficult to maintain. After a few<br />
rounds of changes, it will become spaghetti-like. So, the changes should be evolutionary and additive, leading to<br />
the third constraint:</p>
<div class="hint">
Constraint 3: Changes to the service should allow evolutionary changes to a service/client implementation.</div>
<p>
The idea behind these constraints to make the change process manageable and not make clients tightly-coupled to<br />
the services. In the next part, I will discuss some possibilities, and whether those possibilities honor these<br />
constraints.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.subbu.org/blog/2004/12/web-services-versioning-part-1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
