X

Geertjan's Blog

  • September 13, 2005

Migrating a Web Service Client to JBoss or Tomcat

Geertjan Wielenga
Product Manager
Let's say you've created a web service client and deployed it to the Sun Java System Application Server. But now you realize that you can also deploy it to JBoss and Tomcat. What do you do? Simply change the target server in the Project Properties dialog box? Not good enough -- the client type you used when creating the web service client probably resulted in J2EE container-generated stubs. Neither JBoss (see http://jira.jboss.com/jira/browse/JBWS-381) nor Tomcat support the creation of these stubs -- so you need to make sure that the stubs are created by the IDE. In addition, you should regenerate the calls to the web service, because these are generated differently, depending on the client type you're using. But it's less complex than you might think. It takes four steps:
  1. In project.xml, change jsr-109_client to jaxrpc_static_client.
  2. Close and reopen the project. This regenerates build-impl.xml, using the changed project.xml.
  3. Clean and build the project. During the build, the changed build-impl.xml causes the build to create stubs.
  4. Delete the operation(s) that the IDE created for you and recreate it/them (Web Service Client Resources > Call Web Service Operation).

Now you've re-implemented the web service client so that the stubs are created by the IDE. Go see for yourself -- this is what the client's package looks like for J2EE Container-generated client types:

And this is the same package after I took the steps above:

Do you see that there are a lot more files in the second picture than the first? That's because in the second scenario, the IDE does for you what the server does for you in the first scenario. And, unfortunately, right now, the only server -- as far as I know, anyway -- that creates stubs correctly, according to the JSR-109 specification, is the Sun Java System Application Server. For JBoss, see http://jira.jboss.com/jira/browse/JBWS-381. (Note that I haven't tried WebLogic and WebSphere yet though.)

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.