Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 49207 invoked from network); 2 Feb 2005 09:20:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Feb 2005 09:20:04 -0000 Received: (qmail 62756 invoked by uid 500); 2 Feb 2005 09:20:03 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 62730 invoked by uid 500); 2 Feb 2005 09:20:02 -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 62711 invoked by uid 99); 2 Feb 2005 09:20:02 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,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; Wed, 02 Feb 2005 01:20:01 -0800 Received: (qmail 49139 invoked by uid 65534); 2 Feb 2005 09:20:00 -0000 Message-ID: <20050202092000.49137.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: Wed, 02 Feb 2005 09:20:00 -0000 Subject: svn commit: r149501 - in webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/apache/axis/samples/userguide/example1: EchoString.java InteropTest_Stub.java To: axis-cvs@ws.apache.org From: chathura@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: chathura Date: Wed Feb 2 01:19:58 2005 New Revision: 149501 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D149501 Log: EchoString Completed with manually written stub Modified: webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/apache/a= xis/samples/userguide/example1/EchoString.java webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/apache/a= xis/samples/userguide/example1/InteropTest_Stub.java Modified: webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/ap= ache/axis/samples/userguide/example1/EchoString.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/samples/org/apache/axis/samples/userguide/example1/EchoString.ja= va?view=3Ddiff&r1=3D149500&r2=3D149501 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/samples/org/apache/a= xis/samples/userguide/example1/EchoString.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/apache/a= xis/samples/userguide/example1/EchoString.java Wed Feb 2 01:19:58 2005 @@ -31,7 +31,7 @@ InteropTest_Stub stub =3Dnew InteropTest_Stub(); URL url =3D new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/s= ervices/EchoXMLService"); stub.setEnePointReference(new EndpointReference(AddressingConstants.WSA_= TO, url.toString())); - stub.echoString("does this damn think work"); + System.out.println(stub.echoString("does this damn think work")); =09 =09 } Modified: webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/ap= ache/axis/samples/userguide/example1/InteropTest_Stub.java URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/= prototype2/samples/org/apache/axis/samples/userguide/example1/InteropTest_S= tub.java?view=3Ddiff&r1=3D149500&r2=3D149501 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/samples/org/apache/a= xis/samples/userguide/example1/InteropTest_Stub.java (original) +++ webservices/axis/trunk/java/dev/scratch/prototype2/samples/org/apache/a= xis/samples/userguide/example1/InteropTest_Stub.java Wed Feb 2 01:19:58 20= 05 @@ -17,8 +17,6 @@ =20 import java.util.Iterator; =20 -import javax.xml.namespace.QName; - import org.apache.axis.addressing.EndpointReference; import org.apache.axis.clientapi.Call; import org.apache.axis.engine.AxisFault; @@ -44,17 +42,19 @@ =09 =09 =09 -=09 - //////////////////////User setter methods////////////////////// + ///////////////////////////////////////////////////////////// + /// User setter methods /// + ///////////////////////////////////////////////////////////// =09 public void setEnePointReference(EndpointReference epr){ this.call.setTo(epr); =09 } =09 - //\\\\\\\\\\\\\\\\\\End user setter methods\\\\\\\\\\\\\\\\\\// =09 =09 - /////////////////////Webservice Operations///////////////////// + /////////////////////////////////////////////////////////////// + /// Webservice Operations /// + /////////////////////////////////////////////////////////////// =09 public java.lang.String echoString(java.lang.String inputValue)throws Axi= sFault{ this.validate(); @@ -69,12 +69,6 @@ } =09 =09 - //\\\\\\\\\\\\\\\\End Webservice Operations\\\\\\\\\\\\\\\\\\// -=09 -=09 -=09 -=09 -=09 =09 //////////////////////////////////////////////////////////////// // Util Methods // @@ -84,7 +78,7 @@ protected SOAPEnvelope getSOAPEnvelopForEchoString(String value){ SOAPEnvelope envelop =3D OMFactory.newInstance().getDefaultEnvelope(); OMNamespace interopNamespace =3D envelop.declareNamespace("http://soapin= terop.org/", "interop"); - OMElement echoStringMessage =3D omFactory.createOMElement("echoStringReq= uest", interopNamespace); + OMElement echoStringMessage =3D omFactory.createOMElement("echoString", = interopNamespace); OMElement text =3D omFactory.createOMElement("Text", interopNamespace); text.addChild(omFactory.createText(value)); echoStringMessage.addChild(text); @@ -104,7 +98,7 @@ } =09 =09 - protected String getEchoStringFromSOAPEnvelop(SOAPEnvelope envelop){ + protected String getEchoStringFromSOAPEnvelop(SOAPEnvelope envelop) throw= s AxisFault{ OMElement body =3D envelop.getBody(); OMElement response =3D null; Iterator childrenIter =3D body.getChildren(); @@ -114,12 +108,20 @@ response =3D (OMElement)child; =09 } } =09 - Iterator textChild =3D response.getChildrenWithName(new QName("", "Text"= )); - String value=3D null; - if(textChild.hasNext()){ - value =3D ((String)((OMElement)textChild.next()).getValue()); + Iterator textChild =3D response.getChildren(); + while(textChild.hasNext()){ + OMNode child =3D (OMNode) textChild.next(); + if(child instanceof OMElement && "echoStringReturn".equalsIgnoreCase(((= OMElement)child).getLocalName())){ + =09 + OMNode val =3D((OMElement)child).getFirstChild(); + if(val instanceof OMText) + return new String(((OMText)val).getValue()); + =09 + } } - return value; =09 + =09 + this.log.info("Invalid data Binding"); + throw new AxisFault("Invalid data Binding"); =09 } =09 protected Integer getEchoIntFromSOAPEnvelop(SOAPEnvelope envelop) throws = AxisFault{ @@ -152,18 +154,13 @@ =09 protected void validate() throws AxisFault{ String errorMessage =3D null; - =09 if(null =3D=3D this.call.getTO()) errorMessage =3D "End Point reference is not set: "; =09 - =09 - =09 if(null !=3D errorMessage){ errorMessage =3D "One or more Errors occured :: "+ errorMessage; throw new AxisFault(errorMessage); } - =09 - =09 } =09 }