<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Gridshore software engineering weblog - Webservices</title>
    <link>http://www.gridshore.nl/blog/</link>
    <description>This weblog is about everything that has to do with software engineering. It will focus on items like Springframework, acegi, hibernate and other tools to help creating good software</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2.1 - http://www.s9y.org/</generator>
    <pubDate>Tue, 29 Jan 2008 10:27:03 GMT</pubDate>

    <image>
        <url>http://www.gridshore.nl/blog/templates/gridshore/img/s9y_banner_small.png</url>
        <title>RSS: Gridshore software engineering weblog - Webservices - This weblog is about everything that has to do with software engineering. It will focus on items like Springframework, acegi, hibernate and other tools to help creating good software</title>
        <link>http://www.gridshore.nl/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Last entry ...</title>
    <link>http://www.gridshore.nl/blog/index.php?/archives/74-Last-entry-....html</link>
            <category>acegi</category>
            <category>ajax</category>
            <category>Announcements</category>
            <category>Books</category>
            <category>gridshore</category>
            <category>Java</category>
            <category>News</category>
            <category>spring-osgi</category>
            <category>Springframework</category>
            <category>Technology</category>
            <category>Webservices</category>
            <category>Websites&amp;products</category>
    
    <comments>http://www.gridshore.nl/blog/index.php?/archives/74-Last-entry-....html#comments</comments>
    <wfw:comment>http://www.gridshore.nl/blog/wfwcomment.php?cid=74</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.gridshore.nl/blog/rss.php?version=2.0&amp;type=comments&amp;cid=74</wfw:commentRss>
    

    <author>nospam@example.com (Jettro Coenradie)</author>
    <content:encoded>
    Welcome to the last entry of this blog. No I am not quitting, I am just moving. I just installed a new blog software framework. I was starting to dislike the way to interact and I wanted something that contained more out of the box. I am in the middle of moving to wordpress software. There is a very good reason to do this. I had found a great tool on the mac called MarsEdit. And again this could not be used with serendipity. I hope I did make a good choice. Since there is a lot of information in the old blog, I did not take this blog offline. It will stay to exist, but I will not make changes there anymore.&lt;br /&gt;
&lt;br /&gt;
I hope to see you at the new version of the blog (check the page at http://www.gridshore.nl). You can attach you feedreader to the following url: feed://www.gridshore.nl/feed/ 
    </content:encoded>

    <pubDate>Sat, 19 Jan 2008 20:58:56 +0100</pubDate>
    <guid isPermaLink="false">http://www.gridshore.nl/blog/index.php?/archives/74-guid.html</guid>
    
</item>
<item>
    <title>Web service versioning in the java world</title>
    <link>http://www.gridshore.nl/blog/index.php?/archives/68-Web-service-versioning-in-the-java-world.html</link>
            <category>Webservices</category>
    
    <comments>http://www.gridshore.nl/blog/index.php?/archives/68-Web-service-versioning-in-the-java-world.html#comments</comments>
    <wfw:comment>http://www.gridshore.nl/blog/wfwcomment.php?cid=68</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.gridshore.nl/blog/rss.php?version=2.0&amp;type=comments&amp;cid=68</wfw:commentRss>
    

    <author>nospam@example.com (Allard Buijze)</author>
    <content:encoded>
    &lt;p&gt;There are many blog entries and articles out there about web service versioning. So why write another? In my day-to-day work, I am often asked about how to solve web service versioning issues. The articles on the web provide different ways to do it, but do not take the impact on the codebase, deployment and testing into consideration. Now that&#039;s exactly what I&#039;ll be trying to do in this article.&lt;/p&gt;&lt;p&gt;First, I&#039;ll briefly describe what I mean with Web Service versioning. Then, I&#039;ll shed some light on different possible solutions. Finally, I&#039;ll compare all of these solutions in terms of complexity, codebase, deployment and testing.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Web service versioning, real or just a myth?&lt;/h4&gt;&lt;p&gt;Many, maybe even all, projects that involve web services will encounter a problem they call &quot;web service versioning&quot;. But what is it? And does it really exist?&lt;br /&gt;&lt;br /&gt;A web service is a piece of code, published under a more or less strict contract (WSDL and XSD), that can be called by other pieces of code across the web. This contract poses a problem, because your users depend on this contract to communicate with your application. If your request or response message format changes, it will most probably break the contract, causing your clients to send invalid messages and being unable to parse your responses.&lt;br /&gt;&lt;br /&gt;So, if you change the contract, are we still talking about the same service? Or is it just another service you are providing? In terms of web services, it will be just another service. However, developers think in terms of code and classes. Since the major part of the codebase will be the same for the new service, we like to think of it as a new version. So, web service versioning doesn&#039;t really exist, but we want our classes to be reused. Now we&#039;ve put our finger on the sore spot.&lt;/p&gt;&lt;h4&gt;Why versioning web services is an issue&lt;/h4&gt;&lt;p&gt;Web Service versioning doesn&#039;t exist. So why is it an issue? Because developers (myself included) want to be able to reuse existing classes for new versions of a service. So, in our Version Control System (VCS, e.g. Subversion or CVS) repository weÂ?ll want to create a branch for the old version, and continue development in our main branch. We&#039;d want to deploy our application with our old JAR and the new one and provide some mechanism for selecting either the old classes or the new ones.&lt;br /&gt;&lt;br /&gt;That&#039;s when class loading comes in to play and ruin our day. Java isn&#039;t able to load the two different classes with the same name, at least, not in this case. It will load class com.mycompany.MyService from only one of both jars, whichever is first on the classpath. For java to accept different implementations of a same class, you&#039;d have to do some class loader tricks.&lt;br /&gt;&lt;/p&gt;&lt;p /&gt;&lt;h4&gt;Solutions for service versioning&lt;/h4&gt;&lt;p&gt;The web is full of solutions for versioning. I&#039;ll mention each solution briefly, and explain how it is set up. At the end of this blog entry, I will compare these solutions in terms of codebase, deployment and testing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Don&#039;t do versioning. Force clients to migrate to the newest version available.&lt;/strong&gt;This is often tried as the first solution, but will most likely fail. Often, client applications are managed by another project, not in the area of influence of the project developing the web service provider. The cons are mostly financial: who&#039;s going to pay for the migration of the client? I&#039;m not going into more detail on this solution, as it doesn&#039;t solve the versioning problem.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Deploy another EAR file containing the new version of the web service, leaving the old application untouched.&lt;/strong&gt;In terms of development and maintenance of the codebase, this is the easiest solution. Just create a branch in your VCS for the old version and continue the development in the main branch. Since the old application is totally unmodified, it doesn&#039;t have to be tested when a new version is created. However, your deployers will have to deploy and maintain one applications per supported version.&lt;br /&gt;In case of bug fixes, there is another choice to be made. Will the bug be fixed in each version, or just in the latest one. In the first case, the code has to be changed in several locations in you repository. Fortunately, today&#039;s VCS tools (e.g. TortoiseSVN) allow you to easily merge changes across branches. Then, testers have to test each modified application and the deployer has to redeploy them.&lt;br /&gt;&lt;br /&gt;In conclusion, this solution is easy for the developers, but has more impact on testers and deployers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Deploy a single EAR file, with a WAR file per version&lt;/strong&gt;Beware! For this solution to work, all version specific code should be placed in the WEB-INF/lib dir of your WAR file, and each WAR file must have its own class loader.&lt;br /&gt;&lt;br /&gt;Just like the previous solution, you can create a branch in your VCS and merge changes across branches. However, a change in one version of the code will change the composition of the entire EAR file, and thus affect other versions, even if the specifications of that version haven&#039;t changed. This means that there is no way to guarantee that old versions are unaffected by changes in newer versions. This puts some extra load on the testers. The deployers however will only have to deploy and maintain a single application, regardless of the number of versions it supports.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Use different package names for each version&lt;/strong&gt;On several blog sites, this solution is provided as &amp;quot;the one&amp;quot; to use. If you take java out of the equation, it might be very interesing, because your request and response messages are very clear about the version of the service. However, in the real world, developers use binding frameworks such as jaxb or augis. This would mean different package names (and rewriting code) for each version. This makes solutionÂ the worst of all for developers, as the entire codebase has to be changed for each new version.&lt;br /&gt;&lt;br /&gt;I am not going into detail about this solution, because it is not a solution to the &quot;versioning&quot; problem. Here, we are just creating a completely new service, with all new classes. No resuse. However, do take this option into consideration for at least a few minutes. Depending on the size of your codebase, it might just not be such a bad solution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Use a framework that supports advanced class loading&lt;/strong&gt;People who know me would probable wonder by now: &quot;When will he mention OSGi&quot;?. Well, just about now. Frameworks that implement the OSGi specification (e.g. Equinox, Knoplerfish and Felix), are able to load different implementations of the same class, and understand the difference between them. Jettro Coenradie and I have given a presentation on Web Service versioning using OSGi that the Spring 2007 conference (see &lt;a href=&quot;http://www.nljug.org/pages/events/content/jspring_2007/sessions/00003/&quot;&gt;http://www.nljug.org/pages/events/content/jspring_2007/sessions/00003/&lt;/a&gt;). We&#039;ve also dedicated a website to provide information on the subject: &lt;a href=&quot;http://www.osgisamples.com/&quot;&gt;http://www.osgisamples.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This solution is probably the most difficult one to implement. It is most likely that neither the developers, nor the testers and deployers have knowledge about OSGi and the impact on their work. However, if this knowledge is available to your project, make sure to consider this solution.&lt;/p&gt;&lt;h4&gt;Comparing the solutions&lt;/h4&gt;&lt;p&gt;Now that I have mentioned each solution briefly, it is time to put them in the ring to compete against each other. Here we go:&lt;/p&gt;&lt;h4&gt;&lt;table style=&quot;BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;1&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot; /&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;&lt;strong&gt;EAR versioning&lt;/strong&gt;&lt;br /&gt;(endpoint versioning)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;&lt;strong&gt;WAR versioning&lt;/strong&gt;&lt;br /&gt;(endpoint versioning)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;&lt;strong&gt;Package versioning&lt;/strong&gt;&lt;br /&gt;(namespace versioning)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;&lt;strong&gt;OSGi&lt;/strong&gt;&lt;br /&gt;(any type of versioning you like)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;How the versions are recognized&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;By endpoint&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Either the EARs will be deployed on different app servers, or the WARs inside will have different contexts&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;By endpoint&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Each WAR in the ear wil have a different context (e.g. /services/v1 and /services/v2)&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;By namespace&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;We&#039;re talking about different services here. The dispatching process will send each service to the appropriate class&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Any way you like. You have complete influence on the dispatching process.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Complexity to set up&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;No specific set up to be done. Make sure to use a VCS.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Slightly complex. Use e.g. maven to build the WAR files and include the necessary versions in your EAR. Make sure version specific classes and jars are included inside the WAR.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Not complex at all to set up, but each new version will require you to create new classes or rename the old ones.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Consider each new version as a completely new service in your web service dispatcher&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Very complex for beginners. OSGi introduces some extra features and a different mindset than Â?normalÂ? java programming.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Impact on codebase, bug fixing and maintenance&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Little impact. Keep in mind that each fixed version will have to be redeployed. Use your VCS tools to merge changes across branches.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Little impact. Each modified version will have to be rebuilt and each WAR included in the EAR file. Use your VCS tools to merge changes across branches.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Huge impact. The amount of classes will double with each version. Merging across branches is no longer possible, since class names are different.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;You application will have to be set up in a modular fashion. If it already is, the impact on your codebase is small. You can use VCS tools to merge changes, since class names donÂ?t change.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Impact on deployment effort&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Highest impact on deployers. Each version requires an extra EAR to be maintained.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Small impact on deployers. There is only a single EAR file to deploy and maintain.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Small impact on deployers. There is only a single EAR file to deploy and maintain.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Small impact on deployers. There is only a single EAR file to deploy and maintain.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Impact on testers&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Small impact. Old versions are remained intact when deploying new versions.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Big impact. It is hard to guarantee that old versions are remained intact upon deployment of a new version.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Big impact. It is hard to guarantee that old versions are remained intact upon deployment of a new version.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Big impact. It is hard to guarantee that old versions are remained intact upon deployment of a new version.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Flexibility&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Very high. Since versions are completely separate, changes in one version do not affect the other.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;High. Because all versions share a common (EAR) class loader, there are some limitations. Especially when using native code.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Low. All versions must use the same shared libraries, as all versions share a single class loader.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style=&quot;BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 99.65pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent&quot; valign=&quot;top&quot; width=&quot;133&quot;&gt;&lt;p style=&quot;MARGIN-BOTTOM: 12pt&quot;&gt;&lt;span style=&quot;FONT-SIZE: 10pt; FONT-FAMILY: &quot;&gt;&lt;font face=&quot;verdana,arial,helvetica,sans-serif&quot; color=&quot;#000000&quot; size=&quot;1&quot;&gt;Very high. The versioning and dispatching mechanism is completely configurable to your projects needs. Each version of the web service can depend on different versions of external libraries. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/h4&gt; 
    </content:encoded>

    <pubDate>Mon, 20 Aug 2007 13:04:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.gridshore.nl/blog/index.php?/archives/68-guid.html</guid>
    
</item>
<item>
    <title>Using Spring-ws for creating a webservice</title>
    <link>http://www.gridshore.nl/blog/index.php?/archives/66-Using-Spring-ws-for-creating-a-webservice.html</link>
            <category>Springframework</category>
            <category>Webservices</category>
    
    <comments>http://www.gridshore.nl/blog/index.php?/archives/66-Using-Spring-ws-for-creating-a-webservice.html#comments</comments>
    <wfw:comment>http://www.gridshore.nl/blog/wfwcomment.php?cid=66</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.gridshore.nl/blog/rss.php?version=2.0&amp;type=comments&amp;cid=66</wfw:commentRss>
    

    <author>nospam@example.com (Jettro Coenradie)</author>
    <content:encoded>
    My previous post was about creating a client with the spring-ws project. This dis take me some time to grasp. But without a published webservice a client is of no much use. Therefore I also had a look at the server side. To my surprise this was even easier than expected. I did have some requirements for the sample:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;wsdl generation&lt;/li&gt;&lt;li&gt;marshalling/unmarshalling using jaxb2&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
That does not sound to bad does it? Well try to do it with axis and you&#039;ll be surprised. If you know a little bid about spring-webmvc and the use of the dispatcher, you know you need one configuration file for spring. For the webservice I had to provide the spring config file and one class, yes really, just one class. I used maven to generate the jaxb stuff and this is wat I did:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;strong&gt;web.xml&lt;/strong&gt;&lt;br /&gt;
&amp;lt;servlet&gt;&lt;br /&gt;
  &amp;lt;servlet-name&gt;spring-ws&amp;#160;/servlet-name&gt;&lt;br /&gt;
  &amp;lt;servlet-class&gt;org.springframework.ws.transport.http.MessageDispatcherServlet&amp;lt;/servlet-class&gt;&lt;br /&gt;
&amp;lt;/servlet&gt;&lt;br /&gt;
&amp;lt;servlet-mapping&gt;&lt;br /&gt;
  &amp;lt;servlet-name&gt;spring-ws&amp;#160;/servlet-name&gt;&lt;br /&gt;
  &amp;lt;url-pattern&gt;/*&amp;#160;/url-pattern&gt;&lt;br /&gt;
&amp;lt;/servlet-mapping&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
The spring-ws framework provides a special servlet that receives the requests. No the really hard part, the spring configuration for the endpoint:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;lt;bean class=&quot;org.springframework.ws.server.endpoint.mapping.SimpleMethodEndpointMapping&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;endpoints&quot; ref=&quot;congressRegistrationEndpoint&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;congressRegistrationEndpoint&quot;  class=&quot;nl.gridshore.samples.springws.server.JaxbMarshallingMethodEndpoint&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;marshaller&quot; ref=&quot;marshaller&quot;/&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;unmarshaller&quot; ref=&quot;unmarshaller&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;marshaller&quot; class=&quot;org.springframework.oxm.jaxb.Jaxb2Marshaller&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;contextPath&quot; value=&quot;nl.gridshore.samples.jaxb&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;unmarshaller&quot; class=&quot;org.springframework.oxm.jaxb.Jaxb2Marshaller&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;contextPath&quot; value=&quot;nl.gridshore.samples.jaxb&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
First check the endpoint mapping, this class &lt;em&gt;SimpleMethodEndpointMapping&lt;/em&gt; is found by the dispatcher to map all incoming requests to endpoints. In our case we map to our only endpoint called the congressRegistrationEndpoint. This class has a special super class that needs a marshaller and unmarshaller. Other than that it needs nothing. By convention the name of the Request is used by the super class to know which method to call. In our case we have a CongressRegistrationRequest. Therefore we need to implement to method handleCongressRegistrationRequest as you can see in the following coded block.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
public CongressRegistrationResponse handleCongressRegistrationRequest(CongressRegistrationRequest request) {&lt;br /&gt;
  ObjectFactory objectFactory = new ObjectFactory();&lt;br /&gt;
  CongressRegistrationResponse response = objectFactory.createCongressRegistrationResponse();&lt;br /&gt;
  response.setRegistrationCode(&quot;code333&quot;);&lt;br /&gt;
  return response;&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
In this code the argument and the return value are JAXB objects. I created the most easy method, do nothing with the request and always return the same response. Bu as you can see the code itself is very clean. I do not need to do a lot of conding. I think this is probably one of the easiest implementations I have seen that works in java 1.4 as well.&lt;br /&gt;
&lt;br /&gt;
That is it for one of the requirements. Now I also wanted a solution for generating the wsdl. In the end this is only some springframework configuration. You also need an xsd, but you have already used this to generate the jaxb classes with maven. So we can reuse it. Check the following configuration&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;service&quot; class=&quot;org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;builder&quot;&gt;&lt;br /&gt;
    &amp;lt;bean class=&quot;org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder&quot;&gt;&lt;br /&gt;
      &amp;lt;property name=&quot;schema&quot; value=&quot;/WEB-INF/classes/congressregistration.xsd&quot;/&gt;&lt;br /&gt;
      &amp;lt;property name=&quot;portTypeName&quot; value=&quot;services&quot;/&gt;&lt;br /&gt;
      &amp;lt;property name=&quot;locationUri&quot; value=&quot;http://localhost:8080/spring-ws-sample-server/&quot;/&gt;&lt;br /&gt;
      &amp;lt;property name=&quot;targetNamespace&quot; value=&quot;http://www.gridshore.nl/samples/definitions&quot;/&gt;&lt;br /&gt;
    &amp;lt;/bean&gt;&lt;br /&gt;
  &amp;lt;/property&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
So you need the location of the xsd, the name of the bean is used to find the wsdl. The locationUri locates the endpoint and the targetNamespace is the namespace used in the xsd. By entering the following url you can find the wsdl.&lt;br /&gt;
http://localhost:8080/spring-ws-sample-server/service.wsdl&lt;br /&gt;
&lt;br /&gt;
You can check the code at the &lt;a href=&quot;http://gridshore.googlecode.com/svn/trunk/spring-ws-sample/spring-ws-sample-server/&quot;&gt;google code project&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I know it is pretty short, but with the code you should be able to understand it.&lt;br /&gt;
&lt;br /&gt;
greetz Jettro 
    </content:encoded>

    <pubDate>Wed, 04 Jul 2007 20:33:52 +0200</pubDate>
    <guid isPermaLink="false">http://www.gridshore.nl/blog/index.php?/archives/66-guid.html</guid>
    
</item>
<item>
    <title>Creating a webservice client using Spring-ws and maven2</title>
    <link>http://www.gridshore.nl/blog/index.php?/archives/65-Creating-a-webservice-client-using-Spring-ws-and-maven2.html</link>
            <category>Springframework</category>
            <category>Webservices</category>
    
    <comments>http://www.gridshore.nl/blog/index.php?/archives/65-Creating-a-webservice-client-using-Spring-ws-and-maven2.html#comments</comments>
    <wfw:comment>http://www.gridshore.nl/blog/wfwcomment.php?cid=65</wfw:comment>

    <slash:comments>14</slash:comments>
    <wfw:commentRss>http://www.gridshore.nl/blog/rss.php?version=2.0&amp;type=comments&amp;cid=65</wfw:commentRss>
    

    <author>nospam@example.com (Jettro Coenradie)</author>
    <content:encoded>
    Last week I attended the &lt;a href=&quot;http://www.springone.com&quot;&gt;SpringOne Congress&lt;/a&gt; in Antwerp. Just one or two days before the congress I wanted to create a proof of concept for a client connecting to a webservice. I have been using the proxy way (spring-remote), but I did not really like the way this works. Therefore I was looking for something else. I stumbled upon the  &lt;a href=&quot;http://static.springframework.org/spring-ws/site/&quot;&gt;Spring Webservices&lt;/a&gt; project. I did try this out before, but not for clients. I started working and it did not look very complicated. I must admit I needed the help from Arjen Poutsma himself to make it work, but now I have a very light weight solution. I like the approach very much, therefore I will briefly describe the solution I have created. You can of course find the sources online as well. Check the &lt;a href=&quot;http://gridshore.googlecode.com/svn/trunk/spring-ws-sample/&quot;&gt;google code subversion repo for gridshore&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;Overview of application&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Build application using maven2&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Web application build using spring webmvc&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Webservice client created using spring-ws&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Mapping between objects and xml using jaxb2 and spring-oxm&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h2&gt;Maven 2 for building&lt;/h2&gt;This time not much details about the maven2 part. There are some things interesting though. Most important part is the creation of the jaxb generated classes using the &lt;a href=&quot;https://maven-jaxb2-plugin.dev.java.net/&quot;&gt;maven2 jaxb2 plugin&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;Using spring-webmv for web project&lt;/h2&gt;I do not think it is really interesting to talk a long time about this. There can be found a lot (better) resources online. I used the spring webmvc project to make the client i18n compatible, used the form controllers from spring to help with the error messages and validation stuff. For the webservices part the most interesting thing starts in the file &lt;strong&gt;service-applicationcontext.xml&lt;/strong&gt;. This spring configurtion file contains the webservice client, the converters for jaxb (using generics to abstract the technique marshalling technique).&lt;br /&gt;
&lt;h2&gt;Webservice client created using spring-ws&lt;/h2&gt;Let&#039;s start by having a look at the configuration:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;congressRegistrationDAO&quot;&lt;br /&gt;
    class=&quot;nl.gridshore.samples.springws.integration.wsclient.impl.CongressRegistrationGateway&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;defaultUri&quot; value=&quot;${cr.endpoint}&quot; /&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;marshaller&quot; ref=&quot;marshaller&quot;/&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;unmarshaller&quot; ref=&quot;unmarshaller&quot;/&gt;&lt;br /&gt;
  &amp;lt;constructor-arg index=&quot;0&quot; ref=&quot;congressRegistrationRequestConverter&quot;/&gt;&lt;br /&gt;
  &amp;lt;constructor-arg index=&quot;1&quot; ref=&quot;congressRegistrationResponseConverter&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;marshaller&quot; class=&quot;org.springframework.oxm.jaxb.Jaxb2Marshaller&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;contextPath&quot; value=&quot;nl.gridshore.samples.jaxb&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&amp;lt;bean id=&quot;unmarshaller&quot; class=&quot;org.springframework.oxm.jaxb.Jaxb2Marshaller&quot;&gt;&lt;br /&gt;
  &amp;lt;property name=&quot;contextPath&quot; value=&quot;nl.gridshore.samples.jaxb&quot;/&gt;&lt;br /&gt;
&amp;lt;/bean&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/pre&gt;This configured class is the class that knows how to connect to the webservice. It uses a few values and classes to do it&#039;s work. The defaultUri is used to find the endpoint to connect to (we obtain it from a property file). Since we use JAXB2 to marshall and unmarshall the request we need the marshaller and unmarshaller. These (un)marshallers are provided by spring-ws as well. Actually they are provided by spring-oxm. The interface for the marshaller is the same as for the unmarshaller. The only thing you need to provide is the package where the jaxb files are generatd in. The other two references are converters used to convert the application specific components to JAXB2 components. More on this later as well. So the most important class is the Gateway class. Let&#039;s have a look at that now.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
package nl.gridshore.samples.springws.integration.wsclient.impl;&lt;br /&gt;
&lt;br /&gt;
import nl.gridshore.samples.springws.domain.RegistrationDetails;&lt;br /&gt;
import nl.gridshore.samples.springws.integration.converter.Converter;&lt;br /&gt;
import nl.gridshore.samples.springws.integration.wsclient.CongressRegistrationDAO;&lt;br /&gt;
&lt;br /&gt;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;&lt;br /&gt;
import org.springframework.ws.soap.client.core.SoapActionCallback;&lt;br /&gt;
&lt;br /&gt;
public class CongressRegistrationGateway extends WebServiceGatewaySupport implements CongressRegistrationDAO {&lt;br /&gt;
  private final Converter&lt;Object,RegistrationDetails&gt; requestConverter;&lt;br /&gt;
  private final Converter&lt;String,Object&gt; responseConverter;&lt;br /&gt;
	&lt;br /&gt;
  public CongressRegistrationGateway(Converter&lt;Object,RegistrationDetails&gt; requestConverter,  &lt;br /&gt;
      Converter&lt;String,Object&gt; responseConverter) {&lt;br /&gt;
    this.requestConverter = requestConverter;&lt;br /&gt;
    this.responseConverter = responseConverter;&lt;br /&gt;
  }&lt;br /&gt;
	&lt;br /&gt;
  public String registerForCongress(final RegistrationDetails registrationDetails) {&lt;br /&gt;
    Object request = requestConverter.convert(registrationDetails);&lt;br /&gt;
    &lt;strong&gt;Object response = getWebServiceTemplate().marshalSendAndReceive(request);&lt;/strong&gt;&lt;br /&gt;
    return responseConverter.convert(response);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
This is it, really. I show you the complete class, but in the end the most important works takes place in one line. That&#039;s the one in bold. Here we use the special webServiceTemplate class and ask it to marshall our request object and send it as a soap message to the configured endpoint. Ofcourse you can do a lot more, but for most situations this is all it takes. Do not forget to extend the &lt;strong&gt;WebServiceGatewaySupport&lt;/strong&gt; class. &lt;br /&gt;
&lt;h2&gt;Mapping between objects and xml using jaxb2 and spring-oxm&lt;/h2&gt;Not much to tell here as well. I keep saying this, but that&#039;s because it is true. We have configured the marshaller and the unmarshaller which are provided by spring-oxm. We also call the right method from the template adapter called marshalSendAndReceive. I did create an interface and some implementations that enable the gateway to be ignorand to the type of marshalling and unmarshalling we use. This is my first try to do something with generics. There can be a better way, if you know one, please let me know as well &lt;img src=&quot;http://www.gridshore.nl/blog/templates/gridshore/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. Let&#039;s start with the generic interface.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
public interface Converter&lt;E,T&gt; {&lt;br /&gt;
  public E convert(T toBeConverted);&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
So we have an interface specifying we have a object as a parameter and an object as a return type. Then there is a method called convert that uses these generic types. At the moment I have two concrete implementations for creating the JAXB request and handling the JAXB Response. One of them is presented below.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
public class CongressRegistrationResponseConverter implements Converter&lt;String, CongressRegistrationResponse&gt; {&lt;br /&gt;
  public String convert(CongressRegistrationResponse toBeConverted) {&lt;br /&gt;
    String response = toBeConverted.getRegistrationCode();&lt;br /&gt;
      return response;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
As you can see we now have a concrete implementation for the generic interface. The returned object is a String and the parameter is a JAXB object called CongressRegistrationResponse. Now look back at the gateway code, check that there is no jaxb reference in that code.&lt;br /&gt;
&lt;br /&gt;
Again check out the code at &lt;a href=&quot;http://gridshore.googlecode.com/svn/trunk/spring-ws-sample/&quot;&gt;google code subversion repo for gridshore&lt;/a&gt;. You can already find the code for a server implementation there as well. The next blog will deal with the server. I am also working on a sample about the Rule engine called Drools. so stay tuned. 
    </content:encoded>

    <pubDate>Sat, 30 Jun 2007 21:25:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.gridshore.nl/blog/index.php?/archives/65-guid.html</guid>
    
</item>
<item>
    <title>Providing a webservice with Spring and axis</title>
    <link>http://www.gridshore.nl/blog/index.php?/archives/49-Providing-a-webservice-with-Spring-and-axis.html</link>
            <category>Springframework</category>
            <category>Webservices</category>
    
    <comments>http://www.gridshore.nl/blog/index.php?/archives/49-Providing-a-webservice-with-Spring-and-axis.html#comments</comments>
    <wfw:comment>http://www.gridshore.nl/blog/wfwcomment.php?cid=49</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.gridshore.nl/blog/rss.php?version=2.0&amp;type=comments&amp;cid=49</wfw:commentRss>
    

    <author>nospam@example.com (Jettro Coenradie)</author>
    <content:encoded>
    Finally I found some time to start experimenting with a webservice. I know I am not the first to write about creating your own webservice, still I think this is worth reading. I am writing a step by step creation of a webservice via maven2, axis 1.4 and spring 2.0RC1. Ofcourse you can use older versions, but I want to be ready for the future and keep on using this sample. For now I am working with a HelloWorld sample. I will make it more complicated when needed to show interesting things.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.gridshore.nl/blog/uploads/WebservicePoc.zip&quot; title=&quot;WebservicePoc.zip&quot; target=&quot;_blank&quot;&gt;Download the sources here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Step 1 &lt;/u&gt;- Configuring your maven project environment&lt;/b&gt;&lt;br /&gt;
We create a new directory to store all projects : ~/WebservicePoc&lt;br /&gt;
Within this directory use the archetype of maven to create a structure for a web project:&lt;br /&gt;
The groupid is used within the create pom. The artifactId is used as project id and to create the folder to store all files in. The archetypeArtifactId defines the type of structure to create, in our case a web project.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
mvn archetype:create &lt;br /&gt;
          -DgroupId=com.coenradie.webservicespoc &lt;br /&gt;
          -DartifactId=webservice-jaxrpc-style &lt;br /&gt;
          -DarchetypeArtifactId=maven-archetype-webapp&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Now it is time to create the pom in the root project directory. Beware if you create this pom first, the archetype:create won&#039;t work. Execute the command in a temporary directory and copy the files into the sub-directory of the module we are creating.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
...&lt;br /&gt;
	&amp;lt;groupId&gt;com.coenradie.webservicespoc&amp;lt;/groupId&gt;&lt;br /&gt;
	&amp;lt;version&gt;1.0-SNAPSHOT&amp;lt;/version&gt;&lt;br /&gt;
	&amp;lt;artifactId&gt;WebservicePoc&amp;lt;/artifactId&gt;&lt;br /&gt;
	&amp;lt;packaging&gt;pom&amp;lt;/packaging&gt;&lt;br /&gt;
	&amp;lt;name&gt;Webservice proof of concept&amp;lt;/name&gt;&lt;br /&gt;
	&amp;lt;inceptionYear&gt;2006&amp;lt;/inceptionYear&gt;&lt;br /&gt;
	&amp;lt;url&gt;http://localhost:8080/webservicepoc&amp;lt;/url&gt;&lt;br /&gt;
...&lt;br /&gt;
	&amp;lt;modules&gt;&lt;br /&gt;
		&amp;lt;module&gt;webservice-jaxrpc-style&amp;lt;/module&gt;&lt;br /&gt;
	&amp;lt;/modules&gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
For a complete look at the pom, have a look at the downloadable source code.&lt;br /&gt;
&lt;br /&gt;
We also need to make some adjustments to the generated pom of the webservice-jaxrpc-style module. Again have a look at the sources. Time to try the first compile. Execute the following command in the root of the project:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
~/WebservicePoc/mvn install&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Step 2 &lt;/u&gt; - Decide upon the libraries that we are going to use&lt;/b&gt;&lt;br /&gt;
For the application we are going to create we are going to use some libraries. We do not want to code ourselves to much. We are going to use the spring library and axis. Add these to the module pom.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
  &amp;lt;dependencies&gt;&lt;br /&gt;
    &amp;lt;dependency&gt;&lt;br /&gt;
      &amp;lt;groupId&gt;org.springframework&amp;lt;/groupId&gt;&lt;br /&gt;
      &amp;lt;artifactId&gt;spring&amp;lt;/artifactId&gt;&lt;br /&gt;
      &amp;lt;version&gt;2.0-RC1&amp;lt;/version&gt;&lt;br /&gt;
    &amp;lt;/dependency&gt;&lt;br /&gt;
    &amp;lt;dependency&gt;&lt;br /&gt;
      &amp;lt;groupId&gt;axis&amp;lt;/groupId&gt;&lt;br /&gt;
      &amp;lt;artifactId&gt;axis&amp;lt;/artifactId&gt;&lt;br /&gt;
      &amp;lt;version&gt;1.4&amp;lt;/version&gt;&lt;br /&gt;
    &amp;lt;/dependency&gt;&lt;br /&gt;
    &amp;lt;dependency&gt;&lt;br /&gt;
      &amp;lt;groupId&gt;axis&amp;lt;/groupId&gt;&lt;br /&gt;
      &amp;lt;artifactId&gt;axis-jaxrpc&amp;lt;/artifactId&gt;&lt;br /&gt;
      &amp;lt;version&gt;1.4&amp;lt;/version&gt;&lt;br /&gt;
    &amp;lt;/dependency&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
You will notice a problem with spring and maven 2 at the moment of writing. Maven provides the solution in the error message, we need to install the maven library manually. There aresome other options, but for now this is the easiest one. First download spring version 2.0 RC1, than issue the following command:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
mvn install:install-file &lt;br /&gt;
          -DgroupId=org.springframework &lt;br /&gt;
          -DartifactId=spring &lt;br /&gt;
          -Dversion=2.0-RC1 &lt;br /&gt;
          -Dpackaging=jar&lt;br /&gt;
          -Dfile=%PATH_TO_JAR%/spring.jar&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Step 3&lt;/u&gt; - Time to get the eclipse wtp to work&lt;/b&gt;&lt;br /&gt;
I want to deploy the webservice via tomcat and ofcourse I want a nice environment for debugging, deploying, and developing. I like to work with spring WebTools project, there is a pretty good integration with maven from the maven perspective. Lets use that. Fire up your eclipse (with wtp) and create a workspace. Do not create this workspace inside our projects, do it on another part of the disk. After creating this workspace, add the maven repository as a variable by using the following command:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
mvn eclipse:add-maven-repo -Declipse.workspace=%PATH_TO_WORKSPACE%/WebservicePoc&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Now let maven generate the eclipse project and classpath files, issue the following command:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
mvn -Dwtpversion=1.0 eclipse:eclipse&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
You are ready to import the project into eclipse, &quot;&lt;i&gt;File &gt; Import &gt; Existing projects into workspace&lt;/i&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;step 4&lt;/u&gt; - Lets publish a webservice&lt;/b&gt;&lt;br /&gt;
The webservice is deployed within a web container. Both axis and the spring container run in a servlet. There is a connection between the two via the servlet endpoint which will be discussed in a while. These servlets are configured in the &lt;i&gt;web.xml&lt;/i&gt; file. The template for the file is generated by maven, lets add the servlets, servlet mappings and a spring specific parameter.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
	&amp;lt;context-param&gt;&lt;br /&gt;
		&amp;lt;param-name&gt;contextConfigLocation&amp;lt;/param-name&gt;&lt;br /&gt;
		&amp;lt;param-value&gt;&lt;br /&gt;
			classpath:/applicationContext.xml&lt;br /&gt;
		&amp;lt;/param-value&gt;&lt;br /&gt;
	&amp;lt;/context-param&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
This parameter specifies the locations where spring can find the configuration files for the container. The &lt;i&gt;applicationContext.xml&lt;/i&gt; contains the definition of the beans in the Business service domain. There is another configuration file for spring thats needs to be present. This is the default spring config file based on the name of the servlet that configures the spring container. In our case this file does not contain any beans, but it must be available. It must be called &lt;i&gt;action-servlet.xml&lt;/i&gt; since we have given the spring dispatcher servlet the name action. The file should reside next to the &lt;i&gt;web.xml&lt;/i&gt; in the WEB-INF folder. &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
	&amp;lt;servlet&gt;&lt;br /&gt;
		&amp;lt;servlet-name&gt;action&amp;lt;/servlet-name&gt;&lt;br /&gt;
		&amp;lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&amp;lt;/servlet-class&gt;&lt;br /&gt;
		&amp;lt;load-on-startup&gt;1&amp;lt;/load-on-startup&gt;&lt;br /&gt;
	&amp;lt;/servlet&gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;servlet&gt;&lt;br /&gt;
		&amp;lt;servlet-name&gt;axis&amp;lt;/servlet-name&gt;&lt;br /&gt;
		&amp;lt;servlet-class&gt;org.apache.axis.transport.http.AxisServlet&amp;lt;/servlet-class&gt;&lt;br /&gt;
		&amp;lt;load-on-startup&gt;2&amp;lt;/load-on-startup&gt;&lt;br /&gt;
	&amp;lt;/servlet&gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;servlet-mapping&gt;&lt;br /&gt;
        &amp;lt;servlet-name&gt;action&amp;lt;/servlet-name&gt;&lt;br /&gt;
        &amp;lt;url-pattern&gt;*.html&amp;lt;/url-pattern&gt;&lt;br /&gt;
    &amp;lt;/servlet-mapping&gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;servlet-mapping&gt;&lt;br /&gt;
		&amp;lt;servlet-name&gt;axis&amp;lt;/servlet-name&gt;&lt;br /&gt;
		&amp;lt;url-pattern&gt;/services/*&amp;lt;/url-pattern&gt;&lt;br /&gt;
	&amp;lt;/servlet-mapping&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Here you can see the spring dispatcher servlet and the axis servlet. Most important to notice is the &lt;b&gt;load-on-startup&lt;/b&gt; parameter that tells the order of loading the servlets. The axis servlet connects to the loaded spring context via the special endpoint. Therefore the spring servlet needs to be loaded first. You do not need the dispatcher servlet if you plan to expose only webservices. If you also want to include spring mvc or the like, you do need the dispatcher servlet.&lt;br /&gt;
&lt;br /&gt;
Next task is to configure the axis webservice, this is done via the &lt;i&gt;server-config.wsdd&lt;/i&gt; file.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
	&amp;lt;service name=&quot;JaxrpcwebserviceProvider&quot; provider=&quot;java:RPC&quot;&gt;&lt;br /&gt;
		&amp;lt;parameter name=&quot;className&quot;&lt;br /&gt;
			value=&quot;com.coenradie.webservicepoc.server.jaxrpcstyle.ServiceProvider&quot;/&gt;&lt;br /&gt;
		&amp;lt;parameter name=&quot;allowedMethods&quot; value=&quot;*&quot;/&gt;&lt;br /&gt;
		&amp;lt;beanMapping qname=&quot;webservicepoc:MessageBean&quot; xmlns:webservicepoc=&quot;urn:MessageBean&quot; &lt;br /&gt;
			languageSpecificType=&quot;java:com.coenradie.webservicepoc.server.jaxrpcstyle.MessageBean&quot;/&gt;&lt;br /&gt;
	&amp;lt;/service&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
We are creating a jaxrpc style webservice with the name &lt;i&gt;JaxrpcwebserviceProvider&lt;/i&gt;. Axis should redirect all calls to this service to the endpoint of type ServiceProvider. This is a subclass of a special spring implementation of the servletendpoint, this class is will be discussed later on. As you can see from the wsdd file, all public methods are exposed via the webservice. As a transport object we use the MessageBean.&lt;br /&gt;
&lt;br /&gt;
Now all configuration is in place, time to do some real coding. We need to implement the following classes and interfaces.&lt;br /&gt;
MessageService and MessageServiceImpl - Business service interface and implementation&lt;br /&gt;
MessageBean - Object returned via the jaxrpc webservice&lt;br /&gt;
RemoteMessageService - Remote interface that is implemented by the service endpoint and therefore implemented by the webservice.&lt;br /&gt;
ServiceProvider - the special webservice endpoint that contains access to the laoded spring context. The endpoint contains the method that is called via axis.&lt;pre&gt;&lt;br /&gt;
public interface MessageService {&lt;br /&gt;
	String getMessage();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class MessageServiceImpl implements MessageService {&lt;br /&gt;
	public String getMessage() {&lt;br /&gt;
		return &quot;Message from my server&quot;;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public interface RemoteMessageService extends Remote {&lt;br /&gt;
	public MessageBean getMessage() throws RemoteException;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public class MessageBean implements Serializable {&lt;br /&gt;
	private static final long serialVersionUID = -7014683074252469915L;&lt;br /&gt;
	private String message;&lt;br /&gt;
	private String createDate;&lt;br /&gt;
	&lt;br /&gt;
	public String getCreateDate() {&lt;br /&gt;
		return createDate;&lt;br /&gt;
	}&lt;br /&gt;
	public void setCreateDate(String createDate) {&lt;br /&gt;
		this.createDate = createDate;&lt;br /&gt;
	}&lt;br /&gt;
	public String getMessage() {&lt;br /&gt;
		return message;&lt;br /&gt;
	}&lt;br /&gt;
	public void setMessage(String message) {&lt;br /&gt;
		this.message = message;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
The most important class is the endpoint, this is the class that gets called by axis. The spring superclass takes care of obtaining the spring web context. You can use this context to find spring wired beans. In our case we use it to find the Business service object MessageService.&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
public class ServiceProvider extends ServletEndpointSupport implements RemoteMessageService {&lt;br /&gt;
	private MessageService messageService;&lt;br /&gt;
	&lt;br /&gt;
	protected void onInit() {&lt;br /&gt;
		this.messageService = (MessageService)getWebApplicationContext().getBean(&quot;messageService&quot;);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	public MessageBean getMessage() {&lt;br /&gt;
		MessageBean messageBean = new MessageBean();&lt;br /&gt;
		messageBean.setMessage(messageService.getMessage());&lt;br /&gt;
		messageBean.setCreateDate(new Date().toString());&lt;br /&gt;
		&lt;br /&gt;
		return messageBean;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Time to fire up the server. You can use the run on server with a right mouse click on the project within eclipse wtp. Popup a browser and go to the following url:&lt;br /&gt;
http://localhost:8080/webservice-jaxrpc-style/services&lt;br /&gt;
That should give you an overview of all deployed services, probably only the JaxrpcwebserviceProvider.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Step 5&lt;/i&gt; - Using xml spy to send a message via soap to the webservice&lt;/b&gt;&lt;br /&gt;
The webservice is deployed, you can have a look at the wsdl file, nice. Now we want to call the webservice. We can write a special java client. There is however an easier way with xmlspy. Since this blog item is all about exposing the webservice and not about creating a client, I will use xmlspy.&lt;br /&gt;
&lt;br /&gt;
Fire up xmlspy and use the menu: SOAP &gt; Create new soap request and enter the next url in the pop-up box:&lt;br /&gt;
http://localhost:8080/webservice-jaxrpc-style/services/JaxrpcwebserviceProvider?wsdl&lt;br /&gt;
After clicking oke, choose the getMessage() operating name, the following request is generated:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;lt;SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:SOAP-ENC=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&lt;br /&gt;
	&amp;lt;SOAP-ENV:Body&gt;&lt;br /&gt;
		&amp;lt;m:getMessage xmlns:m=&quot;http://jaxrpcstyle.server.webservicepoc.coenradie.com&quot; SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;/&gt;&lt;br /&gt;
	&amp;lt;/SOAP-ENV:Body&gt;&lt;br /&gt;
&amp;lt;/SOAP-ENV:Envelope&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Then we can send the request over soap via xmlspy: SOAP &gt; Send request to server&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;br /&gt;
&amp;lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;br /&gt;
	&amp;lt;soapenv:Body&gt;&lt;br /&gt;
		&amp;lt;ns1:getMessageResponse soapenv:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:ns1=&quot;http://jaxrpcstyle.server.webservicepoc.coenradie.com&quot;&gt;&lt;br /&gt;
			&amp;lt;getMessageReturn href=&quot;#id0&quot;/&gt;&lt;br /&gt;
		&amp;lt;/ns1:getMessageResponse&gt;&lt;br /&gt;
		&amp;lt;multiRef id=&quot;id0&quot; soapenc:root=&quot;0&quot; soapenv:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xsi:type=&quot;ns2:MessageBean&quot; xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:ns2=&quot;urn:MessageBean&quot;&gt;&lt;br /&gt;
			&amp;lt;createDate xsi:type=&quot;soapenc:string&quot;&gt;Mon Jun 26 09:48:31 CEST 2006&amp;lt;/createDate&gt;&lt;br /&gt;
			&amp;lt;message xsi:type=&quot;soapenc:string&quot;&gt;Message from my server&amp;lt;/message&gt;&lt;br /&gt;
		&amp;lt;/multiRef&gt;&lt;br /&gt;
	&amp;lt;/soapenv:Body&gt;&lt;br /&gt;
&amp;lt;/soapenv:Envelope&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
That concludes this article, I learned a lot while writing this item, hope you learned something while reading. The coming weeks I want to write about creating a client, doing document style webservices, using spring webservices component and security. Stay tuned. 
    </content:encoded>

    <pubDate>Sun, 25 Jun 2006 22:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://www.gridshore.nl/blog/index.php?/archives/49-guid.html</guid>
    
</item>

</channel>
</rss>