In this post I'll describe the conversion of the examples from chapter 11, which deals with EJB 3 Web Services, from Glassfish to JBoss 5.0.0.GA. The modifications required were all concerned with deployment: in particular invoking application server specific tools which generate various web service artefacts. These tools are invoked from the build.xml file.
wsprovide is the JBoss equivalent of the Glassfish wsgen tool and the Weblogic jwsc tool. wsprovide takes as input a Java class file with embedded web service annotations and generates all the artefacts, including a wsdl file, required to create a web service. In JBoss explicit use of wsprovide is optional as web service artefacts are generated at deployment time if they have not already been created by wsprovide. (The use of the Glassfish wsgen tool is also optional; however the Weblogic jwsc tool always needs to be explicitly invoked.)
wsconsume is the JBoss equivalent of the Glassfish wsimport tool and the Weblogic clientgen tool. wsconsume generates from an existing wsdl file the client artefacts that client applications use to invoke JBoss and non-JBoss web services.
The client needs to use WS-Security by creating a META-INF/standard-jaxws-client-config.xml file. A sample file can be found in JBOSS_HOME\server\default\deployers\jbossws.deployer\META-INF. This file needs to be copied to the application directory tree. The file is then edited so that only the Standard WSSecurity Client configuration is left. The edited standard-jaxws-client-config.xml file should look as follows:
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd"> <client-config> <config-name>Standard WSSecurity Client</config-name> <post-handler-chains> <javaee:handler-chain> <javaee:protocol-bindings>##SOAP11_HTTP ##SOAP11_HTTP_MTOM</javaee:protocol-bindings> <javaee:handler> <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name> <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class> </javaee:handler> </javaee:handler-chain> </post-handler-chains> </client-config> </jaxws-config>
This file then needs to be packaged in the client jar file.
There are a large number of jar files that need to be included in the run time classpath. I had quite a job figuring out which jar files these should be only to find the answer in the wsrunclient script which is in the JBOSS_HOME\bin directory. That's it - the next post will be on JBoss EJB3 security. .
Comments
You can follow this conversation by subscribing to the comment feed for this post.