Red Hat Application Server: JOnAS User Guide | ||
---|---|---|
Prev | Chapter 36. Web Service Interoperability between JOnAS and BEA WebLogic | Next |
To create a web service, first develop the corresponding EJB application. Compile the EJB classes and create a JAR file. To create the EJB's container, apply the ant task
wlappc |
<wlappc debug="${debug}" source="interface_ws_jonas.jar" classpath="{java.class.path}:interface_ws_jonas.jar" |
Then, use the ant task servicegen to create the ear application containing the web service.
<servicegen destEar="ears/myWebService.ear" contextURI="web_services" > <service ejbJar="jars/myEJB.jar" targetNamespace="http://www.bea.com/examples/Trader" serviceName="TraderService" serviceURI="/TraderService" generateTypes="True" expandMethods="True" > </service> </servicegen> |
Use the version of ant provided with WebLogic Server.
This EJB provides access to the web service deployed on WebLogic from JOnAS.
To access a web service, generate a client class using the Axis tool WSDL2Java <webservice-url-wsdl>. This command creates four classes:
WSNAME_Locator.java: Service implementation
WSNAME_Port.java: Java Interface
WSNAME_PortStub.java: Stub class
WSNAME.java: Service interface to the corresponding web service.
The tool can also generate the Java classes corresponding to future complex types of web services.