source2wsdd with EJBgen
This example shows how to wirte a web service using ejbgen.
Steps involved in writing this example:
- Write the complex type -
World.java
- Write ejb bean class with ejbgen markup -
HelloWorldBean.java
- Write ant build file to compile and build the service.
build.xml
- compile HelloWorldBean.java to output/ejb
- run ejbgen on HelloWorldBean.java file to generate ejb home,
interface and DD file to output/ejb_tmp
- compile generated output/ejb_tmp/*.java to output/ejb
- copy generated output/ejb_tmp/*.xml DD file to
output/ejb/META-INF
- jar up output/ejb/ to per-ejb.jar
- run ejbc ant task on the pre-ejb.jar file to get the
ejb jar file
- run autotype on the generated ejb interface to generate the
codecs for the non build in types
- run source2wsdd on the Bean source file to generate
web-services.xml deployment file and WSDL file
- put the DD file in output/war/WEB-INF/ directory
- run clientgen on the WSDL file to generate the client jar
- jar up output/war directory as a war file
- compile the client side code
Main.java
- write application.xml DD file and
put it in the output/META-INF directory
- jar up output directory as a ear file
- deploy the applicaiton by copying the ear file into the
applications directory of the server
- Follow the instructions here
to build, run and test the service.