axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: cvs commit: ws-axis/java/samples/ejb/src/samples/ejb NiceThings.java NiceThingsBean.java NiceThingsBeanEJB.java NiceThingsBeanHome.java SimpleBean.java SimpleBeanEJB.java SimpleBeanHome.java
Date Sun, 30 Nov 2003 05:04:59 GMT
Forgot to mention. code was contributed by alanbuxton_uk@yahoo.co.uk (Alan Buxton).

--- dims@apache.org wrote:
> dims        2003/11/29 21:03:45
> 
>   Modified:    java/tools/org/apache/axis/tools/ant/wsdl
>                         Java2WsdlAntTask.java
>   Added:       java/samples/ejb ant-build.xml deploy.wsdd README.txt
>                         undeploy.wsdd
>                java/tools/org/apache/axis/tools/ant/wsdl ComplexType.java
>                java/samples/ejb/META-INF ejb-jar.xml
>                java/samples/ejb/src/samples/ejb NiceThings.java
>                         NiceThingsBean.java NiceThingsBeanEJB.java
>                         NiceThingsBeanHome.java SimpleBean.java
>                         SimpleBeanEJB.java SimpleBeanHome.java
>   Log:
>   Fix for Bug 16838 - EJB/Ant/Java2WSDL
>   
>   Notes:
>   - Adds support in Java2WSDLAntTask for custom serializers/deserializers.
>   - Adds a sample for ejb's.
>   
>   Revision  Changes    Path
>   1.1                  ws-axis/java/samples/ejb/ant-build.xml
>   
>   Index: ant-build.xml
>   ===================================================================
>   <?xml version="1.0" encoding="UTF-8"?>
>   <project name="Session Beans as Web Services" default="deployejb" basedir=".">
>   
>       <property environment="env"/>
>       <property name="deploy.dir" value="${env.JBOSS_DEPLOY}"/>
>       <property name="app.name" value="wsejbsample"/>
>       <property name="build.dir" value="build"/>
>       <property name="src.dir" value="src"/>
>       <property name="metainf.dir" value="META-INF"/>
>   
>       <taskdef resource="axis-tasks.properties"/>
>   
>       <target name="prepare">
>           <delete>
>               <fileset dir="${basedir}" includes="*jar"/>
>           </delete>
>           <mkdir dir="${build.dir}"/>
>       </target>
>   
>       <target name="compile" depends="prepare">
>            <javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" 
>                                       optimize="off" deprecation="off"/>
>       </target>
>       
>       <target name="jar" depends="compile">
>           <jar destfile="${app.name}.jar">
>               <fileset dir="${build.dir}">
>                   <include name="**/*.class" />
>               </fileset>
>               <metainf dir="${metainf.dir}"/>
>           </jar>	
>       </target>
>       
>       <target name="deployejb" depends="jar">
>           <copy file="${app.name}.jar" todir="${deploy.dir}"/>
>       </target>
>       
>       <target name="deployws">
>           <axis-admin xmlfile="deploy.wsdd"/>
>       </target>
>       
>       <target name="undeployws">
>           <axis-admin xmlfile="undeploy.wsdd"/>
>       </target>
>       
>       <target name="simplebean">
>           <axis-java2wsdl	classname="samples.ejb.SimpleBean"
>   			methods="sayHello"
>                           output="simplebean.wsdl"
>                           location="http://localhost:8080/axis/services/SimpleBean"
>                           namespace="http://localhost:8080/axis/services/SimpleBean"
>                           namespaceImpl="http://localhost:8080/axis/services/SimpleBean"/>

>       </target>
>       
>       <target name="nicethingsbean">
>           <axis-java2wsdl	classname="samples.ejb.NiceThingsBean"
>   			methods="sayHello,findNiceThingsFor,updateNiceThingsFor"
>                           output="nicethings.wsdl"
>                           location="http://localhost:8080/axis/services/NiceThingsBean"
>                           namespace="http://localhost:8080/axis/services/NiceThingsBean"
>                           namespaceImpl=
>                               "http://localhost:8080/axis/services/NiceThingsBean">
>               <complextype classname="samples.ejb.NiceThings"
>                            namespace="urn:NiceThingsBean"/>
>   <!-- You can also pass in another serializer/deserializer if you don't want to use
the default
> 
>           BeanSerializerFactory for a particular complextype
>                    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>                    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
 -->
>           </axis-java2wsdl>  
>       </target>        
>   </project>
>   
>   
>   
>   1.1                  ws-axis/java/samples/ejb/deploy.wsdd
>   
>   Index: deploy.wsdd
>   ===================================================================
>   <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>               xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>   
>   <service name="SimpleBean" provider="java:EJB">
>       <parameter name="beanJndiName" value="local/SimpleBeanEJB"/>
>       <parameter name="homeInterfaceName" value="samples.ejb.SimpleBeanHome"/>
>       <parameter name="remoteInterfaceName" value="samples.ejb.SimpleBean"/>
>       <parameter name="allowedMethods" value="sayHello"/>
>   </service>
>   <service name="NiceThingsBean" provider="java:EJB">
>       <parameter name="beanJndiName" value="ejb/NiceThingsBeanEJB"/>
>       <parameter name="homeInterfaceName" value="samples.ejb.NiceThingsBeanHome"/>
>       <parameter name="remoteInterfaceName" value="samples.ejb.NiceThingsBean"/>
>       <parameter name="allowedMethods" value="sayHello findNiceThingsFor updateNiceThingsFor"/>
>       <beanMapping xmlns:ns="urn:NiceThingsBean" qname="ns:NiceThings"
>            languageSpecificType="java:samples.ejb.NiceThings"/>
>   </service>
>   
>   </deployment>
>   
>   
>   
>   1.1                  ws-axis/java/samples/ejb/README.txt
>   
>   Index: README.txt
>   ===================================================================
>   EJBs as Web Services
>   =====================
>   
>   Two beans are defined here.
>   
>   SimpleBeanEJB is a straightfoward adaptation of everybody's favourite: 
>   the HelloWorld routine.
>   
>   NiceThingsBeanEJB is a demonstration of using complex types. It uses NiceThings objects
- each
> NiceThings object holds a person's favourite food, colour and lucky number.
>   
>   Look in the ant build.xml file. The most relevant tasks are:
>   
>   * deployejb: Compiles and deploys the ejbs. You will need to alter the deploy.dir parameter;
> you may also need to add vendor-specific configuration in the META-INF directory in order
to be
> able to deploy 
>   the ejbs.
>   
>   * deployws and undeployws: Deploy and Undeploy the web services respectively.
>   
>   * simplebean and nicethingsbean: Generate wsdl files for each of the services respectively,
> Ant needs to find the ejb classes to do this - the easiest way to do this is to put
> wsejbsample.jar in your classpath
>   
>   
>   1.1                  ws-axis/java/samples/ejb/undeploy.wsdd
>   
>   Index: undeploy.wsdd
>   ===================================================================
>   <undeployment xmlns="http://xml.apache.org/axis/wsdd/">
>       <service name="SimpleBean"/>
>       <service name="NiceThingsBean"/>
>   </undeployment>
>   
>   
>   
>   1.17      +27 -2     ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java
>   
>   Index: Java2WsdlAntTask.java
>   ===================================================================
>   RCS file: /home/cvs/ws-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java,v
>   retrieving revision 1.16
>   retrieving revision 1.17
>   diff -u -r1.16 -r1.17
>   --- Java2WsdlAntTask.java	25 Nov 2003 22:08:55 -0000	1.16
>   +++ Java2WsdlAntTask.java	30 Nov 2003 05:03:45 -0000	1.17
>   @@ -55,6 +55,8 @@
>    
>    import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl;
>    import org.apache.axis.encoding.DefaultTypeMappingImpl;
>   +import org.apache.axis.encoding.TypeMappingImpl;
>   +import org.apache.axis.encoding.TypeMapping;
>    import org.apache.axis.utils.ClassUtils;
>    import org.apache.axis.wsdl.fromJava.Emitter;
>    import org.apache.tools.ant.AntClassLoader;
>   @@ -68,6 +70,9 @@
>    import java.io.StringWriter;
>    import java.util.HashMap;
>    import java.util.StringTokenizer;
>   +import java.util.LinkedList;
>   +import java.util.List;
>   +import java.util.Iterator;
>    
>    /*
>     * Important. we autogenerate the ant task docs from this.
>   @@ -116,6 +121,9 @@
>        private String extraClasses = null;
>        private Path classpath = null;
>        private String soapAction = null;
>   +    private List complexTypes = new LinkedList();
>   +    private TypeMappingImpl tmi;
>   +    private TypeMapping defaultTM;    
> 
=== message truncated ===


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

Mime
View raw message