You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by he...@apache.org on 2005/02/01 15:36:22 UTC
svn commit: r149402 - in webservices/axis/trunk/java/dev/scratch/prototype2:
./ src/samples/sample1/ src/samples/sample1/src/
src/samples/sample1/src/META-INF/ src/samples/sample1/src/org/
src/samples/sample1/src/org/apache/ src/samples/sample1/src/org/apache/axis/
src/samples/sample1/src/org/apache/axis/sample/
src/samples/sample1/src/org/apache/axis/sample/echo/ src/samples/sample2/
src/test/org/apache/axis/engine/
Author: hemapani
Date: Tue Feb 1 06:36:18 2005
New Revision: 149402
URL: http://svn.apache.org/viewcvs?view=rev&rev=149402
Log:
add sample
Added:
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/echo.wsdl
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml (with props)
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java (with props)
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoProvider.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java (with props)
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample2/build.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml?view=diff&r1=149401&r2=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml Tue Feb 1 06:36:18 2005
@@ -9,7 +9,7 @@
xmlns:ant="jelly:ant">
<preGoal name="test:test">
<j:jelly xmlns="jelly:ant">
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/msg/echo"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/sample2"/>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service1"/>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service2"/>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/module1"/>
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/echo.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/echo.wsdl?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/echo.wsdl (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/echo.wsdl Tue Feb 1 06:36:18 2005
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions targetNamespace="http://axis.apache.org/sample/echo" xmlns:impl="http://axis.apache.org/sample/echo" xmlns:intf="http://axis.apache.org/sample/echo" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+<!--WSDL created by Apache Axis version: 1.2RC1
+Built on Sep 29, 2004 (08:29:40 EDT)-->
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://axis.apache.org/sample/echo">
+ <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+ <complexType name="ArrayOf_xsd_string">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ <complexType name="EchoStruct">
+ <sequence>
+ <element name="value13" nillable="true" type="xsd:string"/>
+ <element name="value7" nillable="true" type="xsd:string"/>
+ <element name="value2" nillable="true" type="xsd:string"/>
+ <element name="value10" nillable="true" type="xsd:string"/>
+ <element name="value12" nillable="true" type="xsd:string"/>
+ <element name="value5" nillable="true" type="xsd:string"/>
+ <element name="value6" nillable="true" type="xsd:string"/>
+ <element name="value9" nillable="true" type="xsd:string"/>
+ <element name="value1" nillable="true" type="xsd:string"/>
+ <element name="value11" nillable="true" type="xsd:string"/>
+ <element name="value4" nillable="true" type="xsd:string"/>
+ <element name="value8" nillable="true" type="xsd:string"/>
+ <element name="value3" type="xsd:int"/>
+ </sequence>
+ </complexType>
+ <complexType name="ArrayOfEchoStruct">
+ <complexContent>
+ <restriction base="soapenc:Array">
+ <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:EchoStruct[]"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="echoEchoStructArrayResponse">
+
+ <wsdl:part name="echoEchoStructArrayReturn" type="impl:ArrayOfEchoStruct"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoEchoStructRequest">
+
+ <wsdl:part name="in" type="impl:EchoStruct"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringArrayResponse">
+
+ <wsdl:part name="echoStringArrayReturn" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringResponse">
+
+ <wsdl:part name="echoStringReturn" type="xsd:string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoEchoStructArrayRequest">
+
+ <wsdl:part name="in" type="impl:ArrayOfEchoStruct"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringRequest">
+
+ <wsdl:part name="in" type="xsd:string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoStringArrayRequest">
+
+ <wsdl:part name="in" type="impl:ArrayOf_xsd_string"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="echoEchoStructResponse">
+
+ <wsdl:part name="echoEchoStructReturn" type="impl:EchoStruct"/>
+
+ </wsdl:message>
+
+ <wsdl:portType name="Echo">
+
+ <wsdl:operation name="echoString" parameterOrder="in">
+
+ <wsdl:input name="echoStringRequest" message="impl:echoStringRequest"/>
+
+ <wsdl:output name="echoStringResponse" message="impl:echoStringResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoStringArray" parameterOrder="in">
+
+ <wsdl:input name="echoStringArrayRequest" message="impl:echoStringArrayRequest"/>
+
+ <wsdl:output name="echoStringArrayResponse" message="impl:echoStringArrayResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoEchoStruct" parameterOrder="in">
+
+ <wsdl:input name="echoEchoStructRequest" message="impl:echoEchoStructRequest"/>
+
+ <wsdl:output name="echoEchoStructResponse" message="impl:echoEchoStructResponse"/>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoEchoStructArray" parameterOrder="in">
+
+ <wsdl:input name="echoEchoStructArrayRequest" message="impl:echoEchoStructArrayRequest"/>
+
+ <wsdl:output name="echoEchoStructArrayResponse" message="impl:echoEchoStructArrayResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="echoSoapBinding" type="impl:Echo">
+
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="echoString">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoStringRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoStringResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoStringArray">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoStringArrayRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoStringArrayResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoEchoStruct">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoEchoStructRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoEchoStructResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="echoEchoStructArray">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="echoEchoStructArrayRequest">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="echoEchoStructArrayResponse">
+
+ <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.apache.org/sample/echo"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="EchoService">
+
+ <wsdl:port name="echo" binding="impl:echoSoapBinding">
+
+ <wsdlsoap:address location="http://localhost:8080/axis/services/echo"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml Tue Feb 1 06:36:18 2005
@@ -0,0 +1,7 @@
+<service provider="org.apache.axis.sample.echo.EchoProvider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+ <java:implementation class="org.apache.axis.sample.echo.EchoImpl" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
+ <operation name="echoString" qname="echoString" style="anyStyle" use="anyUse"/>
+ <operation name="echoStringArray" qname="echoStringArray" style="anyStyle" use="anyUse"/>
+ <operation name="echoEchoStruct" qname="echoEchoStruct" style="anyStyle" use="anyUse"/>
+ <operation name="echoEchoStructArray" qname="echoEchoStructArray" style="anyStyle" use="anyUse"/>
+</service>
\ No newline at end of file
Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/META-INF/service.xml
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java Tue Feb 1 06:36:18 2005
@@ -0,0 +1,26 @@
+/**
+ * Echo.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.2RC1 Sep 29, 2004 (08:29:40 EDT) WSDL2Java emitter.
+ */
+
+package org.apache.axis.sample.echo;
+
+public class EchoImpl {
+ public EchoImpl(){}
+ public java.lang.String echoString(java.lang.String in) {
+ return in;
+ }
+ public java.lang.String[] echoStringArray(java.lang.String[] in) {
+ return in;
+ }
+ public org.apache.axis.sample.echo.EchoStruct echoEchoStruct(
+ org.apache.axis.sample.echo.EchoStruct in) {
+ return in;
+ }
+ public org.apache.axis.sample.echo.EchoStruct[] echoEchoStructArray(
+ org.apache.axis.sample.echo.EchoStruct[] in) {
+ return in;
+ }
+}
Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoImpl.java
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoProvider.java?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoProvider.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoProvider.java Tue Feb 1 06:36:18 2005
@@ -0,0 +1,137 @@
+/*
+ * Created on Jan 29, 2005
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.axis.sample.echo;
+
+import java.lang.reflect.Method;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.encoding.Encoder;
+import org.apache.axis.encoding.OutObjectArrayImpl;
+import org.apache.axis.encoding.OutObjectImpl;
+import org.apache.axis.encoding.SimpleTypeEncodingUtils;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.impl.llom.builder.ObjectToOMBuilder;
+import org.apache.axis.impl.providers.SimpleJavaProvider;
+import org.apache.axis.om.OMConstants;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OutObject;
+import org.apache.axis.om.SOAPEnvelope;
+
+public class EchoProvider extends SimpleJavaProvider {
+
+ public Object[] deserializeParameters(XMLStreamReader xpp, Method method)
+ throws AxisFault {
+ Class[] parms = method.getParameterTypes();
+ Object[] objs = new Object[parms.length];
+
+ for (int i = 0; i < parms.length; i++) {
+ if (int.class.equals(parms[i])) {
+ objs[i] =
+ new Integer(SimpleTypeEncodingUtils.deserializeInt(xpp));
+ } else if (String.class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeString(xpp);
+ } else if (String[].class.equals(parms[i])) {
+ objs[i] = SimpleTypeEncodingUtils.deserializeStringArray(xpp);
+ } else if (EchoStruct.class.equals(parms[i])) {
+ Encoder en = new EchoStructEncoder(null);
+ objs[i] = en.deSerialize(xpp);
+ } else if (EchoStruct[].class.equals(parms[i])) {
+ objs[i] =
+ SimpleTypeEncodingUtils.deserializeArray(
+ xpp,
+ new EchoStructEncoder(null));
+ } else {
+ throw new UnsupportedOperationException("Only int,String and String[] is supported yet");
+ }
+ }
+ return objs;
+ }
+
+ public MessageContext invoke(MessageContext msgContext) throws AxisFault {
+ try {
+ //get the implementation class for the Web Service
+ Object obj = getTheImplementationObject(msgContext);
+
+ //find the WebService method
+ Class ImplClass = obj.getClass();
+ AxisOperation op = msgContext.getOperation();
+ String methodName = op.getName().getLocalPart();
+
+
+ Method[] methods = ImplClass.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(methodName)) {
+ this.method = methods[i];
+ break;
+ }
+ }
+ //deserialize (XML-> java)
+ Object[] parms = deserializeParameters(msgContext, method);
+ //invoke the WebService
+
+ EchoImpl echo = (EchoImpl)obj;
+ Object result = null;
+ if("echoEchoStruct".equals(methodName)) {
+ result = echo.echoEchoStruct((EchoStruct)parms[0]);
+ }else if ("echoString".equals(methodName)) {
+ result = echo.echoString((String)parms[0]);
+ }else if ("echoStringArray".equals(methodName)) {
+ result = echo.echoStringArray((String[])parms[0]);
+ }else if ("echoEchoStructArray".equals(methodName)) {
+ Object[] parmsIn = (Object[])parms[0];
+ EchoStruct[] structs = new EchoStruct[parmsIn.length];
+ for (int i = 0; i < structs.length; i++) {
+ structs[i] = (EchoStruct) parmsIn[i];
+
+ }
+ result = echo.echoEchoStructArray(structs);
+ }
+ OutObject outobj = null;
+
+ if (result instanceof String || result instanceof String[]) {
+ outobj = new OutObjectImpl(result);
+ } else if (result instanceof EchoStruct) {
+ outobj = new EchoStructEncoder((EchoStruct) result);
+ } else if (result instanceof EchoStruct[]) {
+ outobj =
+ new OutObjectArrayImpl(
+ (EchoStruct[]) result,
+ new EchoStructEncoder(null));
+ }
+
+ OMFactory fac = OMFactory.newInstance();
+ SOAPEnvelope responseEnvelope = fac.getDefaultEnvelope();
+
+ OMNamespace ns = fac.createOMNamespace("http://soapenc/", "res");
+ OMElement responseMethodName =
+ fac.createOMElement(methodName + "Response", ns);
+ responseEnvelope.getBody().addChild(responseMethodName);
+ OMElement returnelement =
+ fac.createOMElement(methodName + "Return", ns);
+ responseMethodName.addChild(returnelement);
+
+ returnelement.setBuilder(
+ new ObjectToOMBuilder(returnelement, outobj));
+ returnelement.declareNamespace(
+ OMConstants.ARRAY_ITEM_NSURI,
+ "arrays");
+ msgContext.setEnvelope(responseEnvelope);
+
+ return msgContext;
+ } catch (SecurityException e) {
+ throw AxisFault.makeFault(e);
+ } catch (IllegalArgumentException e) {
+ throw AxisFault.makeFault(e);
+ }
+ }
+
+}
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java Tue Feb 1 06:36:18 2005
@@ -0,0 +1,317 @@
+/**
+ * EchoStruct.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis 1.2RC1 Sep 29, 2004 (08:29:40 EDT) WSDL2Java emitter.
+ */
+
+package org.apache.axis.sample.echo;
+
+public class EchoStruct implements java.io.Serializable {
+ private java.lang.String value1;
+ private java.lang.String value10;
+ private java.lang.String value11;
+ private java.lang.String value12;
+ private java.lang.String value13;
+ private java.lang.String value2;
+ private int value3;
+ private java.lang.String value4;
+ private java.lang.String value5;
+ private java.lang.String value6;
+ private java.lang.String value7;
+ private java.lang.String value8;
+ private java.lang.String value9;
+
+ public EchoStruct() {
+ }
+
+ public EchoStruct(
+ java.lang.String value1,
+ java.lang.String value10,
+ java.lang.String value11,
+ java.lang.String value12,
+ java.lang.String value13,
+ java.lang.String value2,
+ int value3,
+ java.lang.String value4,
+ java.lang.String value5,
+ java.lang.String value6,
+ java.lang.String value7,
+ java.lang.String value8,
+ java.lang.String value9) {
+ this.value1 = value1;
+ this.value10 = value10;
+ this.value11 = value11;
+ this.value12 = value12;
+ this.value13 = value13;
+ this.value2 = value2;
+ this.value3 = value3;
+ this.value4 = value4;
+ this.value5 = value5;
+ this.value6 = value6;
+ this.value7 = value7;
+ this.value8 = value8;
+ this.value9 = value9;
+ }
+
+
+ /**
+ * Gets the value1 value for this EchoStruct.
+ *
+ * @return value1
+ */
+ public java.lang.String getValue1() {
+ return value1;
+ }
+
+
+ /**
+ * Sets the value1 value for this EchoStruct.
+ *
+ * @param value1
+ */
+ public void setValue1(java.lang.String value1) {
+ this.value1 = value1;
+ }
+
+
+ /**
+ * Gets the value10 value for this EchoStruct.
+ *
+ * @return value10
+ */
+ public java.lang.String getValue10() {
+ return value10;
+ }
+
+
+ /**
+ * Sets the value10 value for this EchoStruct.
+ *
+ * @param value10
+ */
+ public void setValue10(java.lang.String value10) {
+ this.value10 = value10;
+ }
+
+
+ /**
+ * Gets the value11 value for this EchoStruct.
+ *
+ * @return value11
+ */
+ public java.lang.String getValue11() {
+ return value11;
+ }
+
+
+ /**
+ * Sets the value11 value for this EchoStruct.
+ *
+ * @param value11
+ */
+ public void setValue11(java.lang.String value11) {
+ this.value11 = value11;
+ }
+
+
+ /**
+ * Gets the value12 value for this EchoStruct.
+ *
+ * @return value12
+ */
+ public java.lang.String getValue12() {
+ return value12;
+ }
+
+
+ /**
+ * Sets the value12 value for this EchoStruct.
+ *
+ * @param value12
+ */
+ public void setValue12(java.lang.String value12) {
+ this.value12 = value12;
+ }
+
+
+ /**
+ * Gets the value13 value for this EchoStruct.
+ *
+ * @return value13
+ */
+ public java.lang.String getValue13() {
+ return value13;
+ }
+
+
+ /**
+ * Sets the value13 value for this EchoStruct.
+ *
+ * @param value13
+ */
+ public void setValue13(java.lang.String value13) {
+ this.value13 = value13;
+ }
+
+
+ /**
+ * Gets the value2 value for this EchoStruct.
+ *
+ * @return value2
+ */
+ public java.lang.String getValue2() {
+ return value2;
+ }
+
+
+ /**
+ * Sets the value2 value for this EchoStruct.
+ *
+ * @param value2
+ */
+ public void setValue2(java.lang.String value2) {
+ this.value2 = value2;
+ }
+
+
+ /**
+ * Gets the value3 value for this EchoStruct.
+ *
+ * @return value3
+ */
+ public int getValue3() {
+ return value3;
+ }
+
+
+ /**
+ * Sets the value3 value for this EchoStruct.
+ *
+ * @param value3
+ */
+ public void setValue3(int value3) {
+ this.value3 = value3;
+ }
+
+
+ /**
+ * Gets the value4 value for this EchoStruct.
+ *
+ * @return value4
+ */
+ public java.lang.String getValue4() {
+ return value4;
+ }
+
+
+ /**
+ * Sets the value4 value for this EchoStruct.
+ *
+ * @param value4
+ */
+ public void setValue4(java.lang.String value4) {
+ this.value4 = value4;
+ }
+
+
+ /**
+ * Gets the value5 value for this EchoStruct.
+ *
+ * @return value5
+ */
+ public java.lang.String getValue5() {
+ return value5;
+ }
+
+
+ /**
+ * Sets the value5 value for this EchoStruct.
+ *
+ * @param value5
+ */
+ public void setValue5(java.lang.String value5) {
+ this.value5 = value5;
+ }
+
+
+ /**
+ * Gets the value6 value for this EchoStruct.
+ *
+ * @return value6
+ */
+ public java.lang.String getValue6() {
+ return value6;
+ }
+
+
+ /**
+ * Sets the value6 value for this EchoStruct.
+ *
+ * @param value6
+ */
+ public void setValue6(java.lang.String value6) {
+ this.value6 = value6;
+ }
+
+
+ /**
+ * Gets the value7 value for this EchoStruct.
+ *
+ * @return value7
+ */
+ public java.lang.String getValue7() {
+ return value7;
+ }
+
+
+ /**
+ * Sets the value7 value for this EchoStruct.
+ *
+ * @param value7
+ */
+ public void setValue7(java.lang.String value7) {
+ this.value7 = value7;
+ }
+
+
+ /**
+ * Gets the value8 value for this EchoStruct.
+ *
+ * @return value8
+ */
+ public java.lang.String getValue8() {
+ return value8;
+ }
+
+
+ /**
+ * Sets the value8 value for this EchoStruct.
+ *
+ * @param value8
+ */
+ public void setValue8(java.lang.String value8) {
+ this.value8 = value8;
+ }
+
+
+ /**
+ * Gets the value9 value for this EchoStruct.
+ *
+ * @return value9
+ */
+ public java.lang.String getValue9() {
+ return value9;
+ }
+
+
+ /**
+ * Sets the value9 value for this EchoStruct.
+ *
+ * @param value9
+ */
+ public void setValue9(java.lang.String value9) {
+ this.value9 = value9;
+ }
+
+ }
Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStruct.java
------------------------------------------------------------------------------
svn:executable = *
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java?view=auto&rev=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java Tue Feb 1 06:36:18 2005
@@ -0,0 +1,200 @@
+/*
+ * Created on Jan 29, 2005
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.apache.axis.sample.echo;
+
+import java.io.IOException;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.axis.encoding.Encoder;
+import org.apache.axis.encoding.SimpleTypeEncodingUtils;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMException;
+import org.apache.axis.om.OutObject;
+import org.xml.sax.ContentHandler;
+
+public class EchoStructEncoder implements OutObject,Encoder{
+ private ContentHandler contentHandler;
+ private EchoStruct struct;
+
+ public EchoStructEncoder(EchoStruct struct){
+ this.struct = struct;
+ }
+
+ public Object deSerialize(XMLStreamReader xpp)throws AxisFault{
+ EchoStruct struct = new EchoStruct();
+
+ try{
+ int event = xpp.next();
+ while(true){
+ if(XMLStreamConstants.START_ELEMENT == event){
+ if("value1".equals(xpp.getLocalName())){
+ struct.setValue1(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value2".equals(xpp.getLocalName())){
+ struct.setValue2(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value3".equals(xpp.getLocalName())){
+ struct.setValue3(SimpleTypeEncodingUtils.deserializeInt(xpp));
+ }else if("value4".equals(xpp.getLocalName())){
+ struct.setValue4(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value5".equals(xpp.getLocalName())){
+ struct.setValue5(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value6".equals(xpp.getLocalName())){
+ struct.setValue6(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value7".equals(xpp.getLocalName())){
+ struct.setValue7(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value8".equals(xpp.getLocalName())){
+ struct.setValue8(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value9".equals(xpp.getLocalName())){
+ struct.setValue9(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value10".equals(xpp.getLocalName())){
+ struct.setValue10(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value11".equals(xpp.getLocalName())){
+ struct.setValue11(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value12".equals(xpp.getLocalName())){
+ struct.setValue12(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }else if("value13".equals(xpp.getLocalName())){
+ struct.setValue13(SimpleTypeEncodingUtils.deserializeString(xpp));
+ }
+ }if(XMLStreamConstants.END_ELEMENT == event){
+ break;
+ }if(XMLStreamConstants.END_DOCUMENT == event){
+ throw new AxisFault("premature and of file");
+ }
+ event = xpp.next();
+ }
+
+ return struct;
+ } catch (XMLStreamException e) {
+ throw AxisFault.makeFault(e);
+ }
+
+ }
+
+ public void serialize(XMLStreamWriter writer)throws IOException, XMLStreamException{
+ writer.writeStartElement("value1");
+
+ writer.writeEndElement();
+ }
+
+
+ public void startBuilding(ContentHandler contentHandler) throws OMException {
+ if(contentHandler == null){
+ throw new OMException("Please set the content Handler");
+ }
+ try {
+ contentHandler.startPrefixMapping("s", "http://axis.apache.org");
+ String value = "value1";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value1",null);
+ String strVal = struct.getValue1();
+ char[] str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value1");
+
+ value = "value2";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value2",null);
+ strVal = struct.getValue2();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value2");
+
+ value = "value3";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value3",null);
+ int intVal = struct.getValue3();
+ str = String.valueOf(intVal).toCharArray();
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value3");
+
+ value = "value4";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value4",null);
+ strVal = struct.getValue4();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value4");
+
+ value = "value5";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value5",null);
+ strVal = struct.getValue5();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value5");
+
+ value = "value6";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value6",null);
+ strVal = struct.getValue6();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value6");
+
+ value = "value7";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value7",null);
+ strVal = struct.getValue7();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value7");
+
+ value = "value8";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value8",null);
+ strVal = struct.getValue8();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value8");
+
+ value = "value9";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value9",null);
+ strVal = struct.getValue9();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value9");
+
+ value = "value10";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value10",null);
+ strVal = struct.getValue10();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value10");
+
+ value = "value11";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value11",null);
+ strVal = struct.getValue11();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value11");
+
+ value = "value12";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value12",null);
+ strVal = struct.getValue12();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value12");
+
+ value = "value13";
+ contentHandler.startElement("http://axis.apache.org",value,"s:value13",null);
+ strVal = struct.getValue13();
+ str = ((strVal ==null)?new char[]{}: strVal.toCharArray());
+ contentHandler.characters(str, 0, str.length);
+ contentHandler.endElement("http://axis.apache.org",value,"s:value13");
+
+ } catch (Exception e) {
+ throw new OMException(e);
+ }
+
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.axis.encoding.Encoder#setObject(java.lang.Object)
+ */
+ public void setObject(Object obj) {
+ this.struct = (EchoStruct)obj;
+
+ }
+
+}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample2/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample2/build.xml?view=diff&r1=149401&r2=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample2/build.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sample2/build.xml Tue Feb 1 06:36:18 2005
@@ -5,12 +5,12 @@
<property name="build.classes" location="${build}/classes"/>
<property name="build.lib" location="${build}/lib"/>
<property name="lib" location="lib"/>
- <property name="root" location="../../../../"/>
+ <property name="root" location="../../../"/>
<property name="jar.dir" location="${root}/target/test-resources/deployment/services"/>
<path id="axis.test.classpath">
<path refid="maven.dependency.classpath"></path>
- <pathelement location="../../../../target/classes"/>
+ <pathelement location="${root}/target/classes"/>
</path>
<target name="compile" depends="init" unless="jars.uptodate">
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java?view=diff&r1=149401&r2=149402
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/HandlerFaliureTest.java Tue Feb 1 06:36:18 2005
@@ -89,9 +89,12 @@
engineRegistry.addService(service);
sas = EngineUtils.startServer(engineRegistry);
- callTheService();
- EngineUtils.stopServer();
- Thread.sleep(1000);
+ try{
+ callTheService();
+ }finally{
+ EngineUtils.stopServer();
+ Thread.sleep(1000);
+ }
}
public void testFailureAtServerResponseFlow() throws Exception {
@@ -126,9 +129,12 @@
EngineUtils.createExecutionChains(service);
engineRegistry.addService(service);
sas = EngineUtils.startServer(engineRegistry);
- callTheService();
- EngineUtils.stopServer();
- Thread.sleep(1000);
+ try{
+ callTheService();
+ }finally{
+ EngineUtils.stopServer();
+ Thread.sleep(1000);
+ }
}
@@ -150,7 +156,8 @@
reqEnv.getBody().addChild(method);
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
- EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + EngineUtils.TESTING_PORT + "/axis/services/EchoXMLService");
+ //EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + EngineUtils.TESTING_PORT + "/axis/services/EchoXMLService");
+ EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + (EngineUtils.TESTING_PORT )+ "/axis/services/EchoXMLService");
call.setTo(targetEPR);
SOAPEnvelope resEnv = call.sendReceive(reqEnv);