Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 83752 invoked from network); 1 Feb 2005 14:36:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Feb 2005 14:36:29 -0000 Received: (qmail 32959 invoked by uid 500); 1 Feb 2005 14:36:25 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 32932 invoked by uid 500); 1 Feb 2005 14:36:25 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 32917 invoked by uid 99); 1 Feb 2005 14:36:25 -0000 X-ASF-Spam-Status: No, hits=-9.7 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 01 Feb 2005 06:36:23 -0800 Received: (qmail 83692 invoked by uid 65534); 1 Feb 2005 14:36:22 -0000 Message-ID: <20050201143622.83691.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 01 Feb 2005 14:36:22 -0000 Subject: 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/ To: axis-cvs@ws.apache.org From: hemapani@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: hemapani Date: Tue Feb 1 06:36:18 2005 New Revision: 149402 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D149402 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=3Ddiff&r1=3D149401&r2=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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=3D"jelly:ant"> - + Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sampl= e1/echo.wsdl URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/samples/sample1/echo.wsdl?view=3Dauto&rev=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sampl= e1/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=3Dauto&rev=3D1= 49402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ + + + + + + + \ No newline at end of file Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/= sample1/src/META-INF/service.xml ---------------------------------------------------------------------------= --- svn:executable =3D * Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sampl= e1/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.jav= a?view=3Dauto&rev=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 =3D * Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sampl= e1/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=3Dauto&rev=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 =3D method.getParameterTypes(); + Object[] objs =3D new Object[parms.length]; + + for (int i =3D 0; i < parms.length; i++) { + if (int.class.equals(parms[i])) { + objs[i] =3D + new Integer(SimpleTypeEncodingUtils.deserializeInt(xpp)); + } else if (String.class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeString(xpp); + } else if (String[].class.equals(parms[i])) { + objs[i] =3D SimpleTypeEncodingUtils.deserializeStringArray(xpp); + } else if (EchoStruct.class.equals(parms[i])) { + Encoder en =3D new EchoStructEncoder(null); + objs[i] =3D en.deSerialize(xpp); + } else if (EchoStruct[].class.equals(parms[i])) { + objs[i] =3D + 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=20 + Object obj =3D getTheImplementationObject(msgContext); + =09 + //find the WebService method =20 + Class ImplClass =3D obj.getClass(); + AxisOperation op =3D msgContext.getOperation(); + String methodName =3D op.getName().getLocalPart(); + =09 + =09 + Method[] methods =3D ImplClass.getMethods(); + for (int i =3D 0; i < methods.length; i++) { + if (methods[i].getName().equals(methodName)) { + this.method =3D methods[i]; + break; + } + } + //deserialize (XML-> java) + Object[] parms =3D deserializeParameters(msgContext, method); + //invoke the WebService=20 + + EchoImpl echo =3D (EchoImpl)obj; + Object result =3D null; + if("echoEchoStruct".equals(methodName)) { + result =3D echo.echoEchoStruct((EchoStruct)parms[0]); + }else if ("echoString".equals(methodName)) { + result =3D echo.echoString((String)parms[0]); + }else if ("echoStringArray".equals(methodName)) { + result =3D echo.echoStringArray((String[])parms[0]); + }else if ("echoEchoStructArray".equals(methodName)) { + Object[] parmsIn =3D (Object[])parms[0]; + EchoStruct[] structs =3D new EchoStruct[parmsIn.length]; + for (int i =3D 0; i < structs.length; i++) { + structs[i] =3D (EchoStruct) parmsIn[i]; + + } + result =3D echo.echoEchoStructArray(structs); + } =09 + OutObject outobj =3D null; + + if (result instanceof String || result instanceof String[]) { + outobj =3D new OutObjectImpl(result); + } else if (result instanceof EchoStruct) { + outobj =3D new EchoStructEncoder((EchoStruct) result); + } else if (result instanceof EchoStruct[]) { + outobj =3D + new OutObjectArrayImpl( + (EchoStruct[]) result, + new EchoStructEncoder(null)); + } + + OMFactory fac =3D OMFactory.newInstance(); + SOAPEnvelope responseEnvelope =3D fac.getDefaultEnvelope(); + + OMNamespace ns =3D fac.createOMNamespace("http://soapenc/", "res"); + OMElement responseMethodName =3D + fac.createOMElement(methodName + "Response", ns); + responseEnvelope.getBody().addChild(responseMethodName); + OMElement returnelement =3D + 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/sampl= e1/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.j= ava?view=3Dauto&rev=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 =3D value1; + this.value10 =3D value10; + this.value11 =3D value11; + this.value12 =3D value12; + this.value13 =3D value13; + this.value2 =3D value2; + this.value3 =3D value3; + this.value4 =3D value4; + this.value5 =3D value5; + this.value6 =3D value6; + this.value7 =3D value7; + this.value8 =3D value8; + this.value9 =3D value9; + } + + + /** + * Gets the value1 value for this EchoStruct. + *=20 + * @return value1 + */ + public java.lang.String getValue1() { + return value1; + } + + + /** + * Sets the value1 value for this EchoStruct. + *=20 + * @param value1 + */ + public void setValue1(java.lang.String value1) { + this.value1 =3D value1; + } + + + /** + * Gets the value10 value for this EchoStruct. + *=20 + * @return value10 + */ + public java.lang.String getValue10() { + return value10; + } + + + /** + * Sets the value10 value for this EchoStruct. + *=20 + * @param value10 + */ + public void setValue10(java.lang.String value10) { + this.value10 =3D value10; + } + + + /** + * Gets the value11 value for this EchoStruct. + *=20 + * @return value11 + */ + public java.lang.String getValue11() { + return value11; + } + + + /** + * Sets the value11 value for this EchoStruct. + *=20 + * @param value11 + */ + public void setValue11(java.lang.String value11) { + this.value11 =3D value11; + } + + + /** + * Gets the value12 value for this EchoStruct. + *=20 + * @return value12 + */ + public java.lang.String getValue12() { + return value12; + } + + + /** + * Sets the value12 value for this EchoStruct. + *=20 + * @param value12 + */ + public void setValue12(java.lang.String value12) { + this.value12 =3D value12; + } + + + /** + * Gets the value13 value for this EchoStruct. + *=20 + * @return value13 + */ + public java.lang.String getValue13() { + return value13; + } + + + /** + * Sets the value13 value for this EchoStruct. + *=20 + * @param value13 + */ + public void setValue13(java.lang.String value13) { + this.value13 =3D value13; + } + + + /** + * Gets the value2 value for this EchoStruct. + *=20 + * @return value2 + */ + public java.lang.String getValue2() { + return value2; + } + + + /** + * Sets the value2 value for this EchoStruct. + *=20 + * @param value2 + */ + public void setValue2(java.lang.String value2) { + this.value2 =3D value2; + } + + + /** + * Gets the value3 value for this EchoStruct. + *=20 + * @return value3 + */ + public int getValue3() { + return value3; + } + + + /** + * Sets the value3 value for this EchoStruct. + *=20 + * @param value3 + */ + public void setValue3(int value3) { + this.value3 =3D value3; + } + + + /** + * Gets the value4 value for this EchoStruct. + *=20 + * @return value4 + */ + public java.lang.String getValue4() { + return value4; + } + + + /** + * Sets the value4 value for this EchoStruct. + *=20 + * @param value4 + */ + public void setValue4(java.lang.String value4) { + this.value4 =3D value4; + } + + + /** + * Gets the value5 value for this EchoStruct. + *=20 + * @return value5 + */ + public java.lang.String getValue5() { + return value5; + } + + + /** + * Sets the value5 value for this EchoStruct. + *=20 + * @param value5 + */ + public void setValue5(java.lang.String value5) { + this.value5 =3D value5; + } + + + /** + * Gets the value6 value for this EchoStruct. + *=20 + * @return value6 + */ + public java.lang.String getValue6() { + return value6; + } + + + /** + * Sets the value6 value for this EchoStruct. + *=20 + * @param value6 + */ + public void setValue6(java.lang.String value6) { + this.value6 =3D value6; + } + + + /** + * Gets the value7 value for this EchoStruct. + *=20 + * @return value7 + */ + public java.lang.String getValue7() { + return value7; + } + + + /** + * Sets the value7 value for this EchoStruct. + *=20 + * @param value7 + */ + public void setValue7(java.lang.String value7) { + this.value7 =3D value7; + } + + + /** + * Gets the value8 value for this EchoStruct. + *=20 + * @return value8 + */ + public java.lang.String getValue8() { + return value8; + } + + + /** + * Sets the value8 value for this EchoStruct. + *=20 + * @param value8 + */ + public void setValue8(java.lang.String value8) { + this.value8 =3D value8; + } + + + /** + * Gets the value9 value for this EchoStruct. + *=20 + * @return value9 + */ + public java.lang.String getValue9() { + return value9; + } + + + /** + * Sets the value9 value for this EchoStruct. + *=20 + * @param value9 + */ + public void setValue9(java.lang.String value9) { + this.value9 =3D value9; + } + + } Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/= sample1/src/org/apache/axis/sample/echo/EchoStruct.java ---------------------------------------------------------------------------= --- svn:executable =3D * Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sampl= e1/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/EchoStructEn= coder.java?view=3Dauto&rev=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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; +=09 + public EchoStructEncoder(EchoStruct struct){ + this.struct =3D struct; + } +=09 + public Object deSerialize(XMLStreamReader xpp)throws AxisFault{ + EchoStruct struct =3D new EchoStruct(); + =20 + try{ + int event =3D xpp.next(); + while(true){ + if(XMLStreamConstants.START_ELEMENT =3D=3D 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 =3D=3D event){ + break; + }if(XMLStreamConstants.END_DOCUMENT =3D=3D event){ + throw new AxisFault("premature and of file"); + } + event =3D xpp.next(); + } + + return struct; + } catch (XMLStreamException e) { + throw AxisFault.makeFault(e); + } + + } +=09 + public void serialize(XMLStreamWriter writer)throws IOException, XMLStrea= mException{ + writer.writeStartElement("value1"); + =09 + writer.writeEndElement(); + } + + + public void startBuilding(ContentHandler contentHandler) throws OMExcepti= on { + if(contentHandler =3D=3D null){ + throw new OMException("Please set the content Handler"); + } + try { + contentHandler.startPrefixMapping("s", "http://axis.apache.org"); + String value =3D "value1"; + contentHandler.startElement("http://axis.apache.org",value,"s:value1",n= ull); + String strVal =3D struct.getValue1(); + char[] str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value1"); + + value =3D "value2"; + contentHandler.startElement("http://axis.apache.org",value,"s:value2",n= ull); + strVal =3D struct.getValue2(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value2"); + + value =3D "value3"; + contentHandler.startElement("http://axis.apache.org",value,"s:value3",n= ull); + int intVal =3D struct.getValue3(); + str =3D String.valueOf(intVal).toCharArray(); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value3"); + + value =3D "value4"; + contentHandler.startElement("http://axis.apache.org",value,"s:value4",n= ull); + strVal =3D struct.getValue4(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value4"); + + value =3D "value5"; + contentHandler.startElement("http://axis.apache.org",value,"s:value5",n= ull); + strVal =3D struct.getValue5(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value5"); + + value =3D "value6"; + contentHandler.startElement("http://axis.apache.org",value,"s:value6",n= ull); + strVal =3D struct.getValue6(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value6"); + + value =3D "value7"; + contentHandler.startElement("http://axis.apache.org",value,"s:value7",n= ull); + strVal =3D struct.getValue7(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value7"); + + value =3D "value8"; + contentHandler.startElement("http://axis.apache.org",value,"s:value8",n= ull); + strVal =3D struct.getValue8(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value8"); + + value =3D "value9"; + contentHandler.startElement("http://axis.apache.org",value,"s:value9",n= ull); + strVal =3D struct.getValue9(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value9"); + + value =3D "value10"; + contentHandler.startElement("http://axis.apache.org",value,"s:value10",= null); + strVal =3D struct.getValue10(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value10"); + + value =3D "value11"; + contentHandler.startElement("http://axis.apache.org",value,"s:value11",= null); + strVal =3D struct.getValue11(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value11"); + + value =3D "value12"; + contentHandler.startElement("http://axis.apache.org",value,"s:value12",= null); + strVal =3D struct.getValue12(); + str =3D ((strVal =3D=3Dnull)?new char[]{}: strVal.toCharArray()); + contentHandler.characters(str, 0, str.length); + contentHandler.endElement("http://axis.apache.org",value,"s:value12"); + + value =3D "value13"; + contentHandler.startElement("http://axis.apache.org",value,"s:value13",= null); + strVal =3D struct.getValue13(); + str =3D ((strVal =3D=3Dnull)?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); + } + + =09 + =09 + } + + /* (non-Javadoc) + * @see org.apache.axis.encoding.Encoder#setObject(java.lang.Object) + */ + public void setObject(Object obj) { + this.struct =3D (EchoStruct)obj; + + } + +} Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/sa= mple2/build.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/src/samples/sample2/build.xml?view=3Ddiff&r1=3D149401&r2=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ - + =09 - + =09 Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/a= pache/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=3Dd= iff&r1=3D149401&r2=3D149402 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- 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 @@ =20 engineRegistry.addService(service); sas =3D EngineUtils.startServer(engineRegistry); - callTheService(); - EngineUtils.stopServer(); - Thread.sleep(1000); + try{ + callTheService(); + }finally{ + EngineUtils.stopServer(); + Thread.sleep(1000); + } } =20 public void testFailureAtServerResponseFlow() throws Exception { @@ -126,9 +129,12 @@ EngineUtils.createExecutionChains(service); engineRegistry.addService(service); sas =3D EngineUtils.startServer(engineRegistry); - callTheService(); - EngineUtils.stopServer(); - Thread.sleep(1000); + try{ + callTheService(); + }finally{ + EngineUtils.stopServer(); + Thread.sleep(1000); + } } =20 =20 @@ -150,7 +156,8 @@ reqEnv.getBody().addChild(method); =20 org.apache.axis.clientapi.Call call =3D new org.apache.axis.cl= ientapi.Call(); - EndpointReference targetEPR =3D new EndpointReference(Addressi= ngConstants.WSA_TO, "http://127.0.0.1:" + EngineUtils.TESTING_PORT + "/axis= /services/EchoXMLService"); + //EndpointReference targetEPR =3D new EndpointReference(Addres= singConstants.WSA_TO, "http://127.0.0.1:" + EngineUtils.TESTING_PORT + "/ax= is/services/EchoXMLService"); + EndpointReference targetEPR =3D new EndpointReference(AddressingConstan= ts.WSA_TO, "http://127.0.0.1:" + (EngineUtils.TESTING_PORT )+ "/axis/servic= es/EchoXMLService"); call.setTo(targetEPR); SOAPEnvelope resEnv =3D call.sendReceive(reqEnv); =20