Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Dashboard
Maven User
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>Hi all,</p> <p> below is a sample on how to use maven2 together with xdoclet plugin for generating</p> <p>an EJB 2.1 webservices.</p> <p>The code uses jboss WebServices implementation, and i have deployed successfully this code</p> <p>on jboss 4.0.3 and 4.0.4.GA, although with some small tweak on jboss..</p> <p>I'll let users see how it goes and if you have any problem please mail me back</p> <p>at mmistroni@gmail.com </p> <p>Here i post only EJB source code and relevant part of pom.xml because project is confidential.</p> <p> Here's EJB code</p> <p>----</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> /** * @ejb.bean * name="TServiceSession" * view-type="service-endpoint" * local-jndi-name="mm/ws/ejb/TranslationServiceSessionLocalHome" * * * @ejb.interface * generate="service-endpoint" * service-endpoint-class="com.mm.webservices.TranslationService" * * @wsee.port-component name="TranslationServicePort" * * here i show some ejb ref, in case you need to * * @ejb.ejb-ref * ejb-name="SiteTransmissionType" * ref-name="ejb/SiteTransmissionTypeLocalHome" * * @jboss.ejb-local-ref * ref-name="SiteTransmissionTypeLocalHome" * jndi-name="mytests/SiteTransmissionTypeLocalHome" * */ public class TServiceSessionBean implements javax.ejb.SessionBean { /** * @ejb.create-method */ public void ejbCreate() throws javax.ejb.CreateException { } /*\* * ejbActivate \*/ public void ejbActivate() { } } /** * ejbPassivate */ public void ejbPassivate() { } /*\* * ejbRemove \*/ public void ejbRemove() { } } /** * @ejb.interface-method view-type="all" * * * Receives a transmission from * client * @param siteRef * @param interfaceType * @return * @throws TranslationServiceException */ public Transmission receiveTransmission(String SiteRef, int interfaceType) throws TranslationServiceException { ..... MORE CODE HERE ..... } </pre></td></tr></table> <hr /> <p>and here's pom.xml i am using.<br /> In the same pom.xml i am also generating a client for my webservice, but due to xdoclet limitation</p> <p>when invoking it in multiprojects, i had to write an ant task in order to generate client</p> <p>Here's pom.xml</p> <p>********************************</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>xdoclet-maven-plugin</artifactId> <executions> <execution> <id>generateSources</id> <phase>generate-sources</phase> <goals> <goal>xdoclet</goal> </goals> <configuration> <tasks> <ejbdoclet destDir="${project.build.directory}/generated-sources/xdoclet" excludedTags="@author,@version" ejbSpec="2.1"> dir="ejbModule" includes="**/*Bean.java" /> <homeinterface destDir="${project.build.directory}/generated-sources/xdoclet"> <localhomeinterface destDir="${project.build.directory}/generated-sources/xdoclet"/> <deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF" useIDs="true"/> destDir="${project.build.outputDirectory}/META-INF"/> <jboss version="4.0" destDir="${project.build.outputDirectory}/META-INF" dataSource="${mw.dataSource}" datasourceMapping="Hypersonic SQL" createTable="true" removeTable="true"/> </ejbdoclet> </tasks> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>antTask</id> <phase>process-classes</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools"> <classpath refid="maven.dependency.classpath"/> <classpath> <fileset dir="${jboss.libdir}\client"> <include name="activation.jar"/> <include name="javassist.jar"/> <include name="jboss-common-client.jar"/> <include name="jbossretro-rt.jar"/> <include name="jboss-backport-concurrent.jar"/> <include name="jbossws-client.jar"/> <include name="jboss-xml-binding.jar"/> <include name="concurrent.jar"/> <include name="log4j.jar"/> <include name="mail.jar"/> <include name="wsdl4j.jar"/> </fileset> <fileset dir="${jboss.libdir}\lib\endorsed"> <include name="*.jar"/> </fileset> </classpath> </taskdef> <taskdef name="wsclient" classname="org.jboss.ws.tools.ant.wstools"> <classpath> <fileset dir="${jboss.libdir}\client"> <include name="activation.jar"/> <include name="javassist.jar"/> <include name="jboss-common-client.jar"/> <include name="jbossretro-rt.jar"/> <include name="jboss-backport-concurrent.jar"/> <include name="jbossws-client.jar"/> <include name="jboss-xml-binding.jar"/> <include name="concurrent.jar"/> <include name="log4j.jar"/> <include name="mail.jar"/> <include name="wsdl4j.jar"/> </fileset> <fileset dir="${jboss.libdir}\lib\endorsed"> <include name="*.jar"/> </fileset> </classpath> </taskdef> <echo message="**** copying resources ******"/> <copy toDir="${project.build.outputDirectory}/resources"> <fileset dir="ejbModule/resources"/> </copy> <echo message="********** Running jboss ws **************"/> <wstools dest="${project.build.outputDirectory}/META-INF" config="${workspace.dir}/mware/${myproject}/jboss/wstools-messenger-config.xml"/> <wstools dest="${project.build.outputDirectory}/META-INF" config="${workspace.dir}/mware/${myproject}/jboss/wstools-translation-config.xml"/> <copy toDir="${basedir}/client"> <fileset dir="${project.build.outputDirectory}/META-INF"> <include name="**/*mapping.xml"/> </fileset> <fileset dir="${project.build.outputDirectory}/META-INF/wsdl"> <include name="**/*.wsdl"/> </fileset> </copy> <copy toDir="../mwclient/src/main/resources"> <fileset dir="${project.build.outputDirectory}/META-INF"> <include name="**/*mapping.xml"/> </fileset> <fileset dir="${project.build.outputDirectory}/META-INF/wsdl"> <include name="**/*.wsdl"/> </fileset> </copy> <echo message="********** Generating client.. **************"/> <wsclient dest="mwclient/src/main/java" config="${workspace.dir}/mware/${myproject}/client/wstools-messenger-client-config.xml"/> <wsclient dest="mwclient/src/main/java" config="${workspace.dir}/mware/${myproject}/client/wstools-translation-client-config.xml"/> </tasks> </configuration> </execution> </executions> </plugin> ----and below is one of the wstool*config i am using, in case you need it ************************************************* <configuration xmlns="http://www.jboss.org/jbossws-tools"> <wsdl-java file="${myProject}/client/MessengerService.wsdl"> <mapping file="mss-mapping.xml"/> </wsdl-java> </configuration> As yoiu have noticed , i first generate the config file using wstools <echo message="********* Running jboss ws *************"/> <wstools dest="${project.build.outputDirectory}/META-INF" config="${workspace.dir}/mware/${myProject}/jboss/wstools-messenger-config.xml"/> then i copy it into the 'client directory <copy toDir="${basedir}/client"> <fileset dir="${project.build.outputDirectory}/META-INF"> <include name="**/*mapping.xml"/> </fileset> <fileset dir="${project.build.outputDirectory}/META-INF/wsdl"> <include name="**/*.wsdl"/> </fileset> </copy> And then i generate the client artifact <echo message="********* Generating client.. *************"/> <wsclient dest="mwclient/src/main/java" config="${workspace.dir}/mware/ngenMiddleware/client/wstools-messenger-client-config.xml"/> </pre></td></tr></table> <p> My directory structure (if you are interested in generating client) is</p> <p>mware<br /> !_<em>_</em>_ my project (all ejbs here) |__ client |__ src/main/java</p> <p>!_____mwclient </p> <p> I hope you can get along well with this sample....</p> <p>i'd post whole project,but since it is confidential i had to break it down..so i m expecting that you might have a problem in generating client artifact...due to directory structure......<br /> the EJB par twill work fine though..</p> <p>If you find any problems, mail me privately at mmistroni@gmail.comEnjoy!! Marco</p> <p>PS sorry for my poor wiki-editing skills </p> <table class="confluenceTable"><tbody> <tr> <td class="confluenceTd"><p> <br class="atl-forced-newline" /> </p></td> </tr> </tbody></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced