axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r635653 - in /webservices/axis2/trunk/java/modules/samples/book: ./ src/ src/main/ src/main/samples/ src/main/samples/demo/ src/test/ src/webapp/ src/webapp/WEB-INF/ src/webapp/WEB-INF/services/ src/webapp/WEB-INF/services/BookService/ src/...
Date Mon, 10 Mar 2008 19:01:33 GMT
Author: dims
Date: Mon Mar 10 12:01:12 2008
New Revision: 635653

URL: http://svn.apache.org/viewvc?rev=635653&view=rev
Log:
port my sample from http://wso2.org/library/90 - How to Embed an Axis2 based Web Service in
your Webapp?

Added:
    webservices/axis2/trunk/java/modules/samples/book/
    webservices/axis2/trunk/java/modules/samples/book/README
    webservices/axis2/trunk/java/modules/samples/book/pom.xml
    webservices/axis2/trunk/java/modules/samples/book/src/
    webservices/axis2/trunk/java/modules/samples/book/src/main/
    webservices/axis2/trunk/java/modules/samples/book/src/main/log4j.properties
    webservices/axis2/trunk/java/modules/samples/book/src/main/samples/
    webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/
    webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/Book.java
    webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/BookService.java
    webservices/axis2/trunk/java/modules/samples/book/src/test/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/services.xml
    webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/web.xml

Added: webservices/axis2/trunk/java/modules/samples/book/README
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/README?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/README (added)
+++ webservices/axis2/trunk/java/modules/samples/book/README Mon Mar 10 12:01:12 2008
@@ -0,0 +1,9 @@
+This example shows how to use Axis2 in a servlet container. You must 
+have Maven 2.x installed to build this example.  To build type:
+
+$ mvn install war:war
+
+Rename the resultant war as your_web_app.war and drop it into any servlet engine. 
+The WSDL file for the service should be viewable at:
+
+http://yourhost:port/your_web_app/services/BookService?wsdl
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/samples/book/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/pom.xml?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/pom.xml (added)
+++ webservices/axis2/trunk/java/modules/samples/book/pom.xml Mon Mar 10 12:01:12 2008
@@ -0,0 +1,153 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.axis2.examples</groupId>
+    <artifactId>axis2-book</artifactId>
+    <name>Book Example</name>
+    <version>1.1</version>
+    <inceptionYear>2004</inceptionYear>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.schema</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.neethi</groupId>
+            <artifactId>neethi</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>woodstox</groupId>
+            <artifactId>wstx</artifactId>
+            <version>asl-3.2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>1.6.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-javamail_1.4_spec</artifactId>
+            <version>1.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-activation_1.1_spec</artifactId>
+            <version>1.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>annogen</groupId>
+            <artifactId>annogen</artifactId>
+            <version>0.1.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <warSourceDirectory>${basedir}/src/webapp</warSourceDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+        <sourceDirectory>src/main</sourceDirectory>
+        <testSourceDirectory>src/test</testSourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+        <testResources>
+            <testResource>
+                <directory>src/test</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                    <include>**/*.properties</include>
+                    <include>**/*.wsdl</include>
+                </includes>
+            </testResource>
+        </testResources>
+    </build>
+
+    <!--  needed for XmlSchema -->
+    <repositories>
+        <repository>
+            <id>ibiblio</id>
+            <name>ibiblio maven repository</name>
+            <url>http://ibiblio.org/maven/</url>
+            <layout>legacy</layout>
+        </repository>
+        <repository>
+            <id>apache</id>
+            <name>Apache maven repository</name>
+            <url>http://www.apache.org/dist/java-repository/</url>
+            <layout>legacy</layout>
+        </repository>
+    </repositories>
+
+</project>

Added: webservices/axis2/trunk/java/modules/samples/book/src/main/log4j.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/src/main/log4j.properties?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/src/main/log4j.properties (added)
+++ webservices/axis2/trunk/java/modules/samples/book/src/main/log4j.properties Mon Mar 10
12:01:12 2008
@@ -0,0 +1,21 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=INFO, CONSOLE
+#log4j.rootCategory=INFO, CONSOLE, LOGFILE
+
+# Set the enterprise logger priority to FATAL
+log4j.logger.org.apache.axis2.enterprise=FATAL
+log4j.logger.de.hunsicker.jalopy.io=FATAL
+log4j.logger.httpclient.wire.header=FATAL
+log4j.logger.org.apache.commons.httpclient=FATAL
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d %-5p %c - %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=axis2.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/Book.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/Book.java?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/Book.java (added)
+++ webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/Book.java Mon
Mar 10 12:01:12 2008
@@ -0,0 +1,32 @@
+package samples.demo;
+
+public class Book {
+    private String title;
+    private String isbn;
+    private String author;
+
+    public String getIsbn() {
+        return isbn;
+    }
+
+    public void setIsbn(String isbn) {
+        this.isbn = isbn;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(String author) {
+        this.author = author;
+    }
+}
+

Added: webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/BookService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/BookService.java?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/BookService.java
(added)
+++ webservices/axis2/trunk/java/modules/samples/book/src/main/samples/demo/BookService.java
Mon Mar 10 12:01:12 2008
@@ -0,0 +1,23 @@
+package samples.demo;
+
+public class BookService {
+    private Book onlyBook;
+
+    public BookService() {
+        onlyBook = new Book();
+        onlyBook.setAuthor("Glen Daniels");
+        onlyBook.setTitle("Using Axis2");
+        onlyBook.setIsbn("0123456789");
+    }
+
+    public Book[] getBooks() {
+        return new Book[]{onlyBook};
+    }
+
+    public Book findBook(String isbn) {
+        if (isbn.equals(onlyBook.getIsbn()))
+            return onlyBook;
+
+        return null;
+    }
+}

Added: webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/services.xml?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/services.xml
(added)
+++ webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/services/BookService/META-INF/services.xml
Mon Mar 10 12:01:12 2008
@@ -0,0 +1,16 @@
+<serviceGroup>
+	<service name="BookService"
+             targetNamespace="http://ws.apache.org/axis2/samples/book/">
+		<description>
+			Book sample service
+		</description>
+        <schema schemaNamespace="http://ws.apache.org/axis2/samples/book/xsd/"/>
+        <parameter name="ServiceClass" locked="false">samples.demo.BookService</parameter>
+		<operation name="getBooks">
+			<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+		</operation>
+        <operation name="findBook">
+            <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+        </operation>
+	</service>
+</serviceGroup>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/web.xml?rev=635653&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/web.xml (added)
+++ webservices/axis2/trunk/java/modules/samples/book/src/webapp/WEB-INF/web.xml Mon Mar 10
12:01:12 2008
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+    
+<web-app>
+
+    <servlet>
+        <servlet-name>AxisServlet</servlet-name>
+        <display-name>Apache-Axis Servlet</display-name>
+        <servlet-class>
+            org.apache.axis2.transport.http.AxisServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+  <servlet-mapping>
+    <servlet-name>AxisServlet</servlet-name>
+    <url-pattern>/services/*</url-pattern>
+  </servlet-mapping>
+</web-app>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message