Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

For any one else who suffers from this problem this may save you some time.

If you deploy a web service in JBOSS using EJB annotations a simple example being something like

@Stateless (name="HelloService")
@WebService (
                 serviceName="HelloService" )
public class HelloServiceBean implements HelloServiceRemote
        @WebMethod (operationName="sayHello")
        @WebResult (name="helloResult")
        public String hello ()
                return "hello World";

In Jboss - this generates a WSDL which you can find using the web service admin browser http://<host:8080>/jbossws/services, which tells you the address where the wsdl can be sourced.

The difficulty arises when buidling an standalone JBOSS client to call this service.

What you need to do is run the <jbossASinstall>/bin/wsconsume tool and point it at the wsdl on the server a command line prompt like

wsconsume -k <server uri>?wsdl

this will create client stubs that you can import into your project.

I was using Eclipse as IDE. And this is where the problems arose.

When you build a client project using Eclipse, it cosntructs a default server runtime librarym mines called something like [jboss 4.2 runtime]

This library is constructed of files from all the jboss install /client and /lib/endorsed and <server>/lib directories.

If you look in this list you'll see two jars

jaxws-rt.jar and jaxws-tools.jar

apparently these are only required by the wsconsume tools cause a conflict when you run your application with these jasr in the build path.

I did a lot of experimentation (to get a minimal set of jars that let the client run without errors). I ended up building a custom library of my own and included these jars in the library

from /client jbossws-spi.jar jaxb-api.jar jboss-jaxws.jar jbossws-client.jar jbossclient-all.jar

also from the /lib/endorsed directory you need xercesImpl.jar

the client then happily runs with no errors using the generated files from wsconsume in the client build