Author: mmerz
Date: Fri Mar 4 17:17:08 2005
New Revision: 156216
URL: http://svn.apache.org/viewcvs?view=rev&rev=156216
Log:
Added new sample for simple/xsd types.
Work on wsm-petstore-dashboard. (This sample still requires work (Beehive and
Axis) to go online again.)
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/XsdTypesSample.jws
Modified:
incubator/beehive/trunk/samples/wsm-petstore-dashboard/build.xml
Modified: incubator/beehive/trunk/samples/wsm-petstore-dashboard/build.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-petstore-dashboard/build.xml?view=diff&r1=156215&r2=156216
==============================================================================
--- incubator/beehive/trunk/samples/wsm-petstore-dashboard/build.xml (original)
+++ incubator/beehive/trunk/samples/wsm-petstore-dashboard/build.xml Fri Mar 4
17:17:08 2005
@@ -19,14 +19,16 @@
-->
<project name="wsm-petstore-dashboard" basedir="." default="all">
-
- <import file="../../beehive-imports.xml" />
+
+ <!-- MODIFY THIS PROPERTY IF YOU MOVE THE SAMPLE -->
+ <property name="beehive.home" value="../.." />
+
+ <import file="${beehive.home}/beehive-imports.xml" />
<property
name="wsdl.url"
value="http://localhost:8080/petstoreWeb/PetstoreInventoryManager.jws?wsdl" />
- <property name="app.dir" value="." />
<property name="images.dir" value="images" />
<property name="lib.dir" value="lib" />
<property name="log.dir" value="logs" />
@@ -44,25 +46,6 @@
<target name="all" depends="genClient, compile, run" />
-
- <target name="genClient" depends="dirs">
- <deploy-wsm webappDir="${app.dir}" />
- <copy todir="${lib.dir}">
- <fileset file="WEB-INF/lib/*.jar" />
- </copy>
- <taskdef
- name="wsdl2java"
- classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
- loaderref="axis" >
- <classpath refid="jars"/>
- </taskdef>
- <wsdl2java
- url="${wsdl.url}"
- output="${gen.dir}"
- testcase="yes"
- debug="true" />
- </target>
-
<target name="compile" depends="genClient">
<javac
@@ -80,6 +63,22 @@
debug="true"
source="1.4" />
</target>
+
+
+ <target name="genClient" depends="dirs, deploy.webservice.runtime">
+ <taskdef
+ name="wsdl2java"
+ classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask"
+ loaderref="axis" >
+ <classpath refid="jars"/>
+ </taskdef>
+ <wsdl2java
+ url="${wsdl.url}"
+ output="${gen.dir}"
+ testcase="yes"
+ debug="true" />
+ </target>
+
<target name="test" depends="compile">
@@ -107,7 +106,19 @@
</java>
</target>
-
+
+ <target name="deploy.webservice.runtime" depends="dirs">
+ <copy todir="${lib.dir}" failOnError="true">
+ <fileset dir="${beehive.home}/wsm/lib" includes="**/*.jar"/>
+ <fileset refid="log4j.fileset"/>
+ <fileset refid="xbean.fileset"/>
+ <fileset refid="jsr173.fileset"/>
+ <fileset refid="controls.fileset"/>
+ <fileset refid="velocity.fileset"/>
+ </copy>
+ </target>
+
+
<target name="dirs">
<mkdir dir="${lib.dir}" />
<mkdir dir="${build.dir}" />
Added:
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/XsdTypesSample.jws
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/XsdTypesSample.jws?view=auto&rev=156216
==============================================================================
---
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/XsdTypesSample.jws
(added)
+++
incubator/beehive/trunk/samples/wsm-samples/WEB-INF/src/web/xsdtypes/XsdTypesSample.jws
Fri Mar 4 17:17:08 2005
@@ -0,0 +1,159 @@
+package web.xsdtypes;
+
+/*
+ * Copyright 2004, 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$Factory
+ */
+
+import javax.xml.namespace.QName;
+
+import javax.jws.WebService;
+
+/**
+ * This web service defines several web methods with various types for formal
+ * and return parameters.
+ */
[EMAIL PROTECTED]
+public class XsdTypesSample {
+
+ /**
+ * This method tests "char".
+ * NOTE: A built-in mapping for the primitive type "char" is *not*
+ * available; "char" doesn't have a representation in XML Schema).
+ * A custom type mapping is required to use this type.
+ */
+/*
+ public char testChar(char c) {
+ // todo: count up one...
+ // todo: print it...
+ return c;
+ }
+ */
+
+ /**
+ * This method tests "java.math.BigDecimal".
+ */
+ public java.math.BigDecimal testXsdDecimal(java.math.BigDecimal b) {
+ // todo: count up one...
+ // todo: print it...
+ return b;
+ }
+
+ /**
+ * This method tests "java.math.BigInteger".
+ */
+ public java.math.BigInteger testXsdInteger(java.math.BigInteger b) {
+ // todo: count up one...
+ // todo: print it...
+ return b;
+ }
+
+ /**
+ * This method tests "boolean".
+ */
+ public boolean testXsdBoolean(boolean b) {
+ final boolean _b = !b;
+ System.out.println("Got: " + b + ", returning: " + _b);
+ return _b;
+ }
+
+ /**
+ * This method tests "byte".
+ */
+ public byte testXsdByte(byte b) {
+ // can't print this
+ return b;
+ }
+
+ /**
+ * This method tests "byte[]".
+ */
+ public byte[] testXsdBase64Binary(byte[] b) {
+ // can't print this
+ return b;
+ }
+
+ /**
+ * This method tests "java.util.Calendar".
+ */
+ public java.util.Calendar testXsdDateTime(java.util.Calendar c) {
+ // todo: print it...
+ // todo: count up one...
+ return c;
+ }
+
+ /**
+ * This method tests "double".
+ */
+ public double testXsdDouble(double d) {
+ final double _d = 1.1 * d;
+ System.out.println("Got: " + d + ", returning: " + _d);
+ return _d;
+ }
+
+ /**
+ * This method tests "float".
+ */
+ public float testXsdFloat(float f) {
+ final float _f = 1.1f * f;
+ System.out.println("Got: " + f + ", returning: " + _f);
+ return _f;
+ }
+
+ /**
+ * This method tests "int".
+ */
+ public int testXsdInt(int i) {
+ final int _i = 2 * i;
+ System.out.println("Got: " + i + ", returning: " + _i);
+ return _i;
+ }
+
+ /**
+ * This method tests "long".
+ */
+ public long testXsdLong(long l) {
+ final long _l = 2 * l;
+ System.out.println("Got: " + l + ", returning: " + _l);
+ return _l;
+ }
+
+ /**
+ * This method tests "javax.xml.namespace.QName".
+ */
+ public QName testXsdQName(QName q) {
+ System.out.println("Got: " + q);
+ return q;
+ }
+
+ /**
+ * This method tests "short".
+ */
+ public short testXsdShort(short s) {
+ final short _s = (short) (2 * s);
+ System.out.println("Got: " + s + ", returning: " + _s);
+ return _s;
+ }
+
+ /**
+ * This method tests "java.lang.String".
+ */
+ public String testXsdString(String s) {
+ final String _s = "test::" + s;
+ System.out.println("Got: " + s + ", returning: " + _s);
+ return _s;
+ }
+}
\ No newline at end of file