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 ch...@apache.org on 2005/02/11 10:43:33 UTC

svn commit: r153379 - webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/classes webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3 webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server

Author: chathura
Date: Fri Feb 11 01:43:28 2005
New Revision: 153379

URL: http://svn.apache.org/viewcvs?view=rev&rev=153379
Log:
Samples that run on Tomcat with hot deployment and SimpleAxis Server with.

Added:
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoInt.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoString.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/InteropTest_Stub.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/EchoImpl.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/SampleEnvironmentCreator.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/TestServer.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoInt.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoIntCallBackHandler.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoString.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoStringCallbackHandler.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/InteropTest_Stub.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/EchoImpl.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/TestServer.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/classes/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-M1.jar   (with props)
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-test.jar   (with props)
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/MANIFEST.MF
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/service.xml
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/log4j.properties
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoString.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/EchoImpl.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/LoggingHandler.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/TestServer.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/server.xml

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoInt.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoInt.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoInt.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoInt.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample1.client;
+
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoInt {
+	
+	public static void main(String[] args) throws Exception {
+		InteropTest_Stub clientStub = new InteropTest_Stub();
+		URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis2/services/sample1");
+		clientStub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		Integer echoInt = clientStub.echoInt(new Integer(794));
+		System.out.println(echoInt);
+		
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoString.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoString.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoString.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/EchoString.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample1.client;
+
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoString {
+
+	public static void main(String[] args) throws Exception{
+		InteropTest_Stub stub =new InteropTest_Stub();
+		URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/sample1");
+		stub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		System.out.println(stub.echoString("Hi Chinthaka"));
+		
+		
+	}
+	
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/InteropTest_Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/InteropTest_Stub.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/InteropTest_Stub.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/client/InteropTest_Stub.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample1.client;
+
+import java.util.Iterator;
+
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMNode;
+import org.apache.axis.om.OMText;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This file is hand written for the M1 demp purposes and will be 
+ * auto generated fron WSDLx4Java tool.
+ * 
+ */
+public class InteropTest_Stub {
+
+	private OMFactory omFactory = OMFactory.newInstance();
+	private Call call = new Call();
+	protected Log log = LogFactory.getLog(this.getClass());
+	
+		
+	
+	/////////////////////////////////////////////////////////////
+	///					  User setter methods                 ///
+	/////////////////////////////////////////////////////////////
+	
+	public void setEndPointReference(EndpointReference epr){
+		this.call.setTo(epr);		
+	}
+	
+	
+	
+	///////////////////////////////////////////////////////////////
+	///                  Webservice Operations					///
+	///////////////////////////////////////////////////////////////
+	
+	public java.lang.String echoString(java.lang.String inputValue)throws AxisFault{
+		this.validate();
+		SOAPEnvelope responceEnvelop = call.sendReceive(this.getSOAPEnvelopForEchoString(inputValue));	
+		return this.getEchoStringFromSOAPEnvelop(responceEnvelop);	
+	}
+	
+	public Integer echoInt(Integer inputValue) throws AxisFault{
+		this.validate();
+		SOAPEnvelope responceEnvelop = call.sendReceive(this.getSOAPEnvelopForEchoInt(inputValue));		
+		return this.getEchoIntFromSOAPEnvelop(responceEnvelop);		
+	}
+	
+	
+	
+	////////////////////////////////////////////////////////////////
+	//						Util Methods						  //
+	////////////////////////////////////////////////////////////////
+	
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoString(String value){
+		SOAPEnvelope envelop = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace interopNamespace = envelop.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoStringMessage = omFactory.createOMElement("echoString", interopNamespace);
+		OMElement text = omFactory.createOMElement("Text", interopNamespace);
+		text.addChild(omFactory.createText(value));
+		echoStringMessage.addChild(text);
+		envelop.getBody().addChild(echoStringMessage);
+		return envelop;
+	}
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoInt(Integer value){
+		SOAPEnvelope envelope = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace namespace = envelope.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoIntMessage = omFactory.createOMElement("echoInt", namespace);
+		OMElement text = omFactory.createOMElement("Text", namespace);
+		text.addChild(omFactory.createText(value.toString()));
+		echoIntMessage.addChild(text);
+		envelope.getBody().addChild(echoIntMessage);
+		return envelope;		
+	}
+	
+	
+	protected String getEchoStringFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();
+		OMElement response = null;
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoStringResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoStringReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new String(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");		
+	}
+	
+	protected Integer getEchoIntFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();		
+		OMElement response = null;		
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoIntResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}
+		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoIntReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new Integer(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");	
+	}
+	
+	
+	protected void validate() throws AxisFault{
+		String errorMessage = null;
+		if(null == this.call.getTO())
+			errorMessage = "End Point reference is not set: ";
+		
+		if(null != errorMessage){
+			errorMessage = "One or more Errors occured :: "+ errorMessage;
+			throw new AxisFault(errorMessage);
+		}
+	}
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/EchoImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/EchoImpl.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/EchoImpl.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/EchoImpl.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,30 @@
+/**
+ * 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 samples.userguide.sample1.server;
+
+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 java.lang.Integer echoInt(java.lang.Integer 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;
+//	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/SampleEnvironmentCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/SampleEnvironmentCreator.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/SampleEnvironmentCreator.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/SampleEnvironmentCreator.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample1.server;
+
+import java.io.FileReader;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.SimpleAxisOperationImpl;
+import org.apache.axis.engine.EngineRegistry;
+import org.apache.axis.engine.EngineRegistryImpl;
+import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.testUtils.SimpleJavaProvider;
+import org.apache.axis.transport.http.SimpleHTTPReceiver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class SampleEnvironmentCreator extends  AbstractTestCase{
+	
+    private Log log = LogFactory.getLog(getClass());
+    private QName serviceName = new QName("","sample1");
+    private QName operationName1 = new QName("http://localhost/my","echoInt");
+    private QName operationName2 = new QName("http://localhost/my","echoString");
+    private QName transportName = new QName("http://localhost/my","NullTransport");
+
+    private EngineRegistry engineRegistry;
+    private MessageContext mc;
+    private Thread thisThread = null;
+    private SimpleHTTPReceiver sas;
+    
+    public SampleEnvironmentCreator(){
+        super(SampleEnvironmentCreator.class.getName());
+//        try {
+//			this.setUp();
+//			this.testInt();
+//			this.tearDown();
+//		} catch (Exception e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+        
+    }
+
+    public SampleEnvironmentCreator(String testName) {
+        super(testName);
+    }
+    
+    public void setUp() throws Exception {
+        AxisGlobal global = new AxisGlobal();
+        engineRegistry = new EngineRegistryImpl(global);
+        
+        AxisService service = new AxisService(serviceName);
+        service.setClassLoader(Thread.currentThread().getContextClassLoader());
+        service.setServiceClass(EchoImpl.class);
+        service.setProvider(new SimpleJavaProvider());
+
+        AxisOperation operation1 = new SimpleAxisOperationImpl(operationName1);
+        service.addOperation(operation1);
+        
+        AxisOperation operation2 = new SimpleAxisOperationImpl(operationName2);
+        service.addOperation(operation2);
+
+        EngineUtils.createExecutionChains(service);
+        engineRegistry.addService(service);
+        
+        sas = EngineUtils.startServer(engineRegistry);        
+    }
+    
+    
+    protected void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+}
+
+
+public void testInt() throws Exception{
+    try{
+   
+        Call call = new Call();
+        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+        EndpointReference epr = new EndpointReference(AddressingConstants.WSA_TO, url.toString());
+        call.setTo(epr);
+        SOAPEnvelope reply = call.sendReceive(this.getechoIntEnvelope());
+        reply.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+        
+    }catch(Exception e){
+        e.printStackTrace();
+        tearDown();
+        throw e;
+    }    
+}
+public void testString() throws Exception{
+//    try{
+//        OMFactory fac = OMFactory.newInstance();
+//
+//        OMNamespace omNs = fac.createOMNamespace("http://localhost/my","my");
+//        OMElement method =  fac.createOMElement("echoOMElement",omNs) ;
+//        OMElement value =  fac.createOMElement("myValue",omNs) ;
+//        value.setValue("Isaac Assimov, the foundation Sega");
+//        method.addChild(value);
+//        
+//        Call call = new Call();
+//        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+//        
+//        CallBack callback = new CallBack() {
+//            public void doWork(OMElement ele) {
+//                System.out.print("got the result = " + ele +" :)");
+//
+//            }
+//            public void reportError(Exception e) {
+//                log.info("reporting error from callback !");
+//                e.printStackTrace();
+//            }
+//        };
+//        
+//        call.asyncCall(method,url,callback);
+//        log.info("send the reqest");
+//        
+//        Thread.sleep(1000);
+//    }catch(Exception e){
+//        e.printStackTrace();
+//        tearDown();
+//        throw e;
+//    }    
+}
+
+ public static void main(String[] args) {
+ 	new SampleEnvironmentCreator();
+	
+}
+
+private SOAPEnvelope getechoIntEnvelope() throws Exception {
+
+    SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
+            new FileReader(getTestResourceFile("echo/echoInt.xml")))).getSOAPEnvelope();
+    envelope.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+    return envelope;
+}
+	
+    
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/TestServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/TestServer.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/TestServer.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample1/src/samples/userguide/sample1/server/TestServer.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample1.server;
+
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class TestServer {
+
+	public static void main(String[] args) throws Exception {
+		
+		new SampleEnvironmentCreator().setUp();
+		Thread.sleep(300000);
+	}
+	
+	protected void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+        System.out.println("Server shuting down......");
+	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoInt.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoInt.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoInt.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoInt.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineUtils;
+
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoInt {
+
+	
+	
+	public static void main(String[] args) throws Exception {
+		InteropTest_Stub clientStub = new InteropTest_Stub();
+		URL url= null;
+		try {
+			url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/echo");
+		} catch (MalformedURLException e) {
+			
+			e.printStackTrace();
+			System.exit(0);
+		}
+		System.out.println("Initializing the Web service Call ....");
+		clientStub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		clientStub.setListenerTransport("http", true);
+		try {
+			System.out.println("Sending the Async message ....");
+			clientStub.echoInt(new Integer(794), new EchoIntCallBackHandler());
+			
+		} catch (AxisFault e1) {
+			
+			e1.printStackTrace();
+		}
+		
+		System.out.println("Message sent and the client thread sleep till the resonce ....");		
+		Thread.sleep(6000);
+				
+	}
+	
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoIntCallBackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoIntCallBackHandler.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoIntCallBackHandler.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoIntCallBackHandler.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.client;
+
+import org.apache.axis.clientapi.AsyncResult;
+import org.apache.axis.clientapi.Callback;
+import org.apache.axis.engine.AxisFault;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoIntCallBackHandler implements Callback {
+
+	
+	public void onComplete(AsyncResult result) {
+		
+		try {
+			System.out.println("Clent is called back. The echoed value is :"+new InteropTest_Stub().getEchoStringFromSOAPEnvelop(result.getResponseEnvelope()));
+		} catch (AxisFault e) {
+			
+			e.printStackTrace();
+		}		
+
+	}
+
+	
+	public void reportError(Exception e) {
+		System.out.println("An Error Pccured !!!");
+		e.printStackTrace();
+
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoString.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoString.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoString.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoString.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoString {
+
+	public static void main(String[] args) throws Exception{
+		InteropTest_Stub clientStub = new InteropTest_Stub();
+		URL url= null;
+		try {
+			url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+		} catch (MalformedURLException e) {
+			
+			e.printStackTrace();
+			System.exit(0);
+		}
+		System.out.println("Initializing the Web service Call ....");
+		clientStub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		clientStub.setListenerTransport("http", true);
+		try {
+			System.out.println("Sending the Async message ....");
+			clientStub.echoString("Dont fear death, rather a unlived life", new EchoIntCallBackHandler());
+			
+		} catch (AxisFault e1) {
+			
+			e1.printStackTrace();
+		}
+		
+		System.out.println("Message sent and the client thread sleep till the resonce ....");		
+		Thread.sleep(6000);
+		
+	}
+	
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoStringCallbackHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoStringCallbackHandler.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoStringCallbackHandler.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/EchoStringCallbackHandler.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.client;
+
+import org.apache.axis.clientapi.AsyncResult;
+import org.apache.axis.clientapi.Callback;
+import org.apache.axis.engine.AxisFault;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoStringCallbackHandler implements Callback {
+
+	public void onComplete(AsyncResult result) {
+		
+		try {
+			System.out.println("Clent is called back. The echoed value is :"+new InteropTest_Stub().getEchoStringFromSOAPEnvelop(result.getResponseEnvelope()));
+		} catch (AxisFault e) {
+			
+			e.printStackTrace();
+		}		
+
+	}
+
+	public void reportError(Exception e) {
+		System.out.println("An Error Pccured !!!");
+		e.printStackTrace();
+
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/InteropTest_Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/InteropTest_Stub.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/InteropTest_Stub.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/client/InteropTest_Stub.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.client;
+
+import java.util.Iterator;
+
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.clientapi.Callback;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMNode;
+import org.apache.axis.om.OMText;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This file is hand written for the M1 demp purposes and will be 
+ * auto generated fron WSDLx4Java tool.
+ * 
+ */
+public class InteropTest_Stub {
+
+	private OMFactory omFactory = OMFactory.newInstance();
+	private Call call = new Call();
+	protected Log log = LogFactory.getLog(this.getClass());
+	
+		
+	
+	/////////////////////////////////////////////////////////////
+	///					  User setter methods                 ///
+	/////////////////////////////////////////////////////////////
+	
+	public void setEndPointReference(EndpointReference epr){
+		this.call.setTo(epr);		
+	}
+	
+	public void setListenerTransport(String transport, boolean blocked){
+		call.setListenerTransport("http",blocked);
+	}
+	
+	
+	
+	///////////////////////////////////////////////////////////////
+	///                  Webservice Operations					///
+	///////////////////////////////////////////////////////////////
+	
+	public void echoString(java.lang.String inputValue, Callback callback)throws AxisFault{
+		this.validate();
+		call.sendReceiveAsync(this.getSOAPEnvelopForEchoString(inputValue), callback);	
+			
+	}
+	
+	public void echoInt(Integer inputValue, Callback callback) throws AxisFault{
+		this.validate();
+		call.sendReceiveAsync(this.getSOAPEnvelopForEchoInt(inputValue), callback);		
+		
+	}
+	
+	
+	
+	////////////////////////////////////////////////////////////////
+	//						Util Methods						  //
+	////////////////////////////////////////////////////////////////
+	
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoString(String value){
+		SOAPEnvelope envelop = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace interopNamespace = envelop.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoStringMessage = omFactory.createOMElement("echoString", interopNamespace);
+		OMElement text = omFactory.createOMElement("Text", interopNamespace);
+		text.addChild(omFactory.createText(value));
+		echoStringMessage.addChild(text);
+		envelop.getBody().addChild(echoStringMessage);
+		return envelop;
+	}
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoInt(Integer value){
+		SOAPEnvelope envelope = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace namespace = envelope.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoIntMessage = omFactory.createOMElement("echoInt", namespace);
+		OMElement text = omFactory.createOMElement("Text", namespace);
+		text.addChild(omFactory.createText(value.toString()));
+		echoIntMessage.addChild(text);
+		envelope.getBody().addChild(echoIntMessage);
+		return envelope;		
+	}
+	
+	
+	public String getEchoStringFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();
+		OMElement response = null;
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoStringResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoStringReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new String(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");		
+	}
+	
+	public Integer getEchoIntFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();		
+		OMElement response = null;		
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoIntResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}
+		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoIntReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new Integer(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");	
+	}
+	
+	
+	protected void validate() throws AxisFault{
+		String errorMessage = null;
+		if(null == this.call.getTO())
+			errorMessage = "End Point reference is not set: ";
+		
+		if(null != errorMessage){
+			errorMessage = "One or more Errors occured :: "+ errorMessage;
+			throw new AxisFault(errorMessage);
+		}
+	}
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/EchoImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/EchoImpl.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/EchoImpl.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/EchoImpl.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,30 @@
+/**
+ * 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 samples.userguide.sample2.server;
+
+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 java.lang.Integer echoInt(java.lang.Integer 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;
+//	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/SampleEnvironmentCreator.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,171 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.server;
+
+import java.io.FileReader;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.SimpleAxisOperationImpl;
+import org.apache.axis.engine.EngineRegistry;
+import org.apache.axis.engine.EngineRegistryImpl;
+import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.testUtils.SimpleJavaProvider;
+import org.apache.axis.transport.http.SimpleHTTPReceiver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class SampleEnvironmentCreator extends  AbstractTestCase{
+	
+    private Log log = LogFactory.getLog(getClass());
+    private QName serviceName = new QName("","EchoXMLService");
+    private QName operationName1 = new QName("http://localhost/my","echoInt");
+    private QName operationName2 = new QName("http://localhost/my","echoString");
+    private QName transportName = new QName("http://localhost/my","NullTransport");
+
+    private EngineRegistry engineRegistry;
+    private MessageContext mc;
+    private Thread thisThread = null;
+    private SimpleHTTPReceiver sas;
+    
+    public SampleEnvironmentCreator(){
+        super(SampleEnvironmentCreator.class.getName());
+//        try {
+//			this.setUp();
+//			this.testInt();
+//			this.tearDown();
+//		} catch (Exception e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+        
+    }
+
+    public SampleEnvironmentCreator(String testName) {
+        super(testName);
+    }
+    
+    public void setUp() throws Exception {
+        AxisGlobal global = new AxisGlobal();
+        engineRegistry = new EngineRegistryImpl(global);
+        
+        AxisService service = new AxisService(serviceName);
+        service.setClassLoader(Thread.currentThread().getContextClassLoader());
+        service.setServiceClass(EchoImpl.class);
+        service.setProvider(new SimpleJavaProvider());
+
+        AxisOperation operation1 = new SimpleAxisOperationImpl(operationName1);
+        service.addOperation(operation1);
+        
+        AxisOperation operation2 = new SimpleAxisOperationImpl(operationName2);
+        service.addOperation(operation2);
+
+        EngineUtils.createExecutionChains(service);
+        engineRegistry.addService(service);
+        
+        sas = EngineUtils.startServer(engineRegistry);        
+    }
+    
+    
+    protected void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+}
+
+
+public void testInt() throws Exception{
+    try{
+   
+        Call call = new Call();
+        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+        EndpointReference epr = new EndpointReference(AddressingConstants.WSA_TO, url.toString());
+        call.setTo(epr);
+        SOAPEnvelope reply = call.sendReceive(this.getechoIntEnvelope());
+        reply.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+        
+    }catch(Exception e){
+        e.printStackTrace();
+        tearDown();
+        throw e;
+    }    
+}
+public void testString() throws Exception{
+//    try{
+//        OMFactory fac = OMFactory.newInstance();
+//
+//        OMNamespace omNs = fac.createOMNamespace("http://localhost/my","my");
+//        OMElement method =  fac.createOMElement("echoOMElement",omNs) ;
+//        OMElement value =  fac.createOMElement("myValue",omNs) ;
+//        value.setValue("Isaac Assimov, the foundation Sega");
+//        method.addChild(value);
+//        
+//        Call call = new Call();
+//        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+//        
+//        CallBack callback = new CallBack() {
+//            public void doWork(OMElement ele) {
+//                System.out.print("got the result = " + ele +" :)");
+//
+//            }
+//            public void reportError(Exception e) {
+//                log.info("reporting error from callback !");
+//                e.printStackTrace();
+//            }
+//        };
+//        
+//        call.asyncCall(method,url,callback);
+//        log.info("send the reqest");
+//        
+//        Thread.sleep(1000);
+//    }catch(Exception e){
+//        e.printStackTrace();
+//        tearDown();
+//        throw e;
+//    }    
+}
+
+ public static void main(String[] args) {
+ 	new SampleEnvironmentCreator();
+	
+}
+
+private SOAPEnvelope getechoIntEnvelope() throws Exception {
+
+    SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
+            new FileReader(getTestResourceFile("echo/echoInt.xml")))).getSOAPEnvelope();
+    envelope.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+    return envelope;
+}
+	
+    
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/TestServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/TestServer.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/TestServer.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample2/src/samples/userguide/sample2/server/TestServer.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample2.server;
+
+import org.apache.axis.engine.EngineUtils;
+
+import samples.userguide.sample1.server.SampleEnvironmentCreator;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class TestServer {
+
+	public static void main(String[] args) throws Exception {
+		
+		new SampleEnvironmentCreator().setUp();
+		System.out.println("Simple Axis Server started ....");
+		Thread.sleep(300000);
+		tearDown();
+	}
+	
+	protected static void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+        System.out.println("Server shuting down......");
+	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml Fri Feb 11 01:43:28 2005
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<!-- ====================================================================== 
+     Feb 11, 2005 1:04:21 PM                                                        
+
+      This build file is intended to compile and run the Axis2 sample
+      provided here with the service being deployed at Tomcat or by
+      running a simple Axis2 server.   
+     
+                   
+     Chathura                                                                
+     ====================================================================== -->
+<project name="Sample3" basedir="." default="jar">
+	<property name="src.dir" value="src" />
+	<property name="classes.dir" value="classes" />
+	<property name="build.dir" value="build" />
+	<property name="lib.dir" value="lib" />
+
+
+	<property name="root" location="../../../.." />
+
+	<path id="axis.test.classpath">
+		<path refid="maven.dependency.classpath">
+		</path>
+		<pathelement location="${root}/target/classes" />
+	</path>
+
+	<target name="clean" description="Delete all generated files">
+		<delete dir="${classes.dir}" />
+		<delete dir="${build.dir}" />
+	</target>
+
+	<target name="validate">
+
+	</target>
+
+	<target name="createDir">
+		<mkdir dir="${build.dir}" />
+		<mkdir dir="${classes.dir}" />
+	</target>
+
+	<target name="compile" depends="validate,createDir">
+		<javac srcdir="${src.dir}" destdir="${classes.dir}" classpath="axis.test.classpath">
+
+		</javac>
+	</target>
+
+	<target name="jar" depends="compile">
+
+	</target>
+
+</project>
+

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-M1.jar
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-M1.jar?view=auto&rev=153379
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-M1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-test.jar
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-test.jar?view=auto&rev=153379
==============================================================================
Binary file - no diff available.

Propchange: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/lib/axis2-test.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/MANIFEST.MF?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/MANIFEST.MF (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/MANIFEST.MF Fri Feb 11 01:43:28 2005
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Created-By: Ant 1.4.1
+

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/service.xml?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/service.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/service.xml Fri Feb 11 01:43:28 2005
@@ -0,0 +1,44 @@
+<service provider="org.apache.axis.testUtils.SimpleJavaProvider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+    <java:implementation class="samples.userguide.sample3.server.EchoImpl" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
+
+    <!-- these are Service Parameters -->
+    <!--
+    <parameter name="para1" locked="xsd:true">10</parameter>
+    <parameter name="para2" locked="xsd:false">Colombo</parameter>
+
+    <module ref="module1"></module>
+    <module ref="module2"></module>
+-->
+
+    <!--  Service TypeMapping -->
+
+
+
+    <!--
+    Phases
+    P1 p2 p3
+    -->
+
+    <inflow>
+        <handler name="LoggingHandler" class="samples.userguide.sample3.server.LoggingHandler">
+        <!--Phase Ordering (e.g. phaseFirst="true") will be introdeced from M2-->
+            <order phase="Logging"/>            
+        </handler>        
+    </inflow>
+
+    <outflow>
+        
+    </outflow>
+
+    <faultflow>
+        <handler name="LoggingHandler" class="samples.userguide.sample3.server.LoggingHandler">
+        <!--Phase Ordering (e.g. phaseFirst="true") will be introdeced from M2-->
+            <order phase="Logging"/>            
+        </handler>
+    </faultflow>
+
+
+    <operation name="echoInt" qname="http://localhost/my:echoInt"/>
+    <operation name="echoString" qname="http://localhost/my:echoString"/>
+    
+</service>
\ No newline at end of file

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/log4j.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/log4j.properties?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/log4j.properties (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/log4j.properties Fri Feb 11 01:43:28 2005
@@ -0,0 +1,20 @@
+#### Use two appenders, one to log to console, another to log to a file
+log4j.rootCategory=DEBUG, CONSOLE, LOGFILE
+
+####  appender writes to a file
+log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
+log4j.appender.LOGFILE.File=axis.log
+
+# Control the maximum log file size
+log4j.appender.LOGFILE.MaxFileSize=10000KB
+# Archive log files (one backup file here)
+log4j.appender.LOGFILE.MaxBackupIndex=100
+
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%6r %5p [%t] (%F:%L) - %m%n
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.client;
+
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoInt {
+	
+	public static void main(String[] args) throws Exception {
+		InteropTest_Stub clientStub = new InteropTest_Stub();
+		URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis2/services/sample3");
+		clientStub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		Integer echoInt = clientStub.echoInt(new Integer(794));
+		System.out.println(echoInt);
+		
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoString.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoString.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoString.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoString.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.client;
+
+import java.net.URL;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class EchoString {
+
+	public static void main(String[] args) throws Exception{
+		InteropTest_Stub stub =new InteropTest_Stub();
+		URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis2/services/sample3");
+		stub.setEndPointReference(new EndpointReference(AddressingConstants.WSA_TO, url.toString()));
+		System.out.println(stub.echoString("Hi Axis2 Sync with a Logging Handler"));
+		
+		
+	}
+	
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.client;
+
+import java.util.Iterator;
+
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMNode;
+import org.apache.axis.om.OMText;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This file is hand written for the M1 demp purposes and will be 
+ * auto generated fron WSDLx4Java tool.
+ * 
+ */
+public class InteropTest_Stub {
+
+	private OMFactory omFactory = OMFactory.newInstance();
+	private Call call = new Call();
+	protected Log log = LogFactory.getLog(this.getClass());
+	
+		
+	
+	/////////////////////////////////////////////////////////////
+	///					  User setter methods                 ///
+	/////////////////////////////////////////////////////////////
+	
+	public void setEndPointReference(EndpointReference epr){
+		this.call.setTo(epr);		
+	}
+	
+	
+	
+	///////////////////////////////////////////////////////////////
+	///                  Webservice Operations					///
+	///////////////////////////////////////////////////////////////
+	
+	public java.lang.String echoString(java.lang.String inputValue)throws AxisFault{
+		this.validate();
+		SOAPEnvelope responceEnvelop = call.sendReceive(this.getSOAPEnvelopForEchoString(inputValue));	
+		return this.getEchoStringFromSOAPEnvelop(responceEnvelop);	
+	}
+	
+	public Integer echoInt(Integer inputValue) throws AxisFault{
+		this.validate();
+		SOAPEnvelope responceEnvelop = call.sendReceive(this.getSOAPEnvelopForEchoInt(inputValue));		
+		return this.getEchoIntFromSOAPEnvelop(responceEnvelop);		
+	}
+	
+	
+	
+	////////////////////////////////////////////////////////////////
+	//						Util Methods						  //
+	////////////////////////////////////////////////////////////////
+	
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoString(String value){
+		SOAPEnvelope envelop = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace interopNamespace = envelop.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoStringMessage = omFactory.createOMElement("echoString", interopNamespace);
+		OMElement text = omFactory.createOMElement("Text", interopNamespace);
+		text.addChild(omFactory.createText(value));
+		echoStringMessage.addChild(text);
+		envelop.getBody().addChild(echoStringMessage);
+		return envelop;
+	}
+	
+	protected SOAPEnvelope getSOAPEnvelopForEchoInt(Integer value){
+		SOAPEnvelope envelope = OMFactory.newInstance().getDefaultEnvelope();
+		OMNamespace namespace = envelope.declareNamespace("http://soapinterop.org/", "interop");
+		OMElement echoIntMessage = omFactory.createOMElement("echoInt", namespace);
+		OMElement text = omFactory.createOMElement("Text", namespace);
+		text.addChild(omFactory.createText(value.toString()));
+		echoIntMessage.addChild(text);
+		envelope.getBody().addChild(echoIntMessage);
+		return envelope;		
+	}
+	
+	
+	protected String getEchoStringFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();
+		try {
+			envelop.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), true);
+		} catch (XMLStreamException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (FactoryConfigurationError e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		OMElement response = null;
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoStringResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoStringReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new String(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");		
+	}
+	
+	protected Integer getEchoIntFromSOAPEnvelop(SOAPEnvelope envelop) throws AxisFault{
+		OMElement body = envelop.getBody();		
+		OMElement response = null;		
+		Iterator childrenIter = body.getChildren();
+		while(childrenIter.hasNext()){
+			OMNode child = (OMNode) childrenIter.next();
+			if(child instanceof OMElement && "echoIntResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				response = (OMElement)child;				
+			}
+		}
+		
+		Iterator textChild = response.getChildren();
+		while(textChild.hasNext()){
+			OMNode  child = (OMNode) textChild.next();
+			if(child instanceof OMElement && "echoIntReturn".equalsIgnoreCase(((OMElement)child).getLocalName())){
+				
+				OMNode val =((OMElement)child).getFirstChild();
+				if(val instanceof OMText)
+					return new Integer(((OMText)val).getValue());
+				
+			}
+		}
+		
+		this.log.info("Invalid data Binding");
+		throw new AxisFault("Invalid data Binding");	
+	}
+	
+	
+	protected void validate() throws AxisFault{
+		String errorMessage = null;
+		if(null == this.call.getTO())
+			errorMessage = "End Point reference is not set: ";
+		
+		if(null != errorMessage){
+			errorMessage = "One or more Errors occured :: "+ errorMessage;
+			throw new AxisFault(errorMessage);
+		}
+	}
+	
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/EchoImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/EchoImpl.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/EchoImpl.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/EchoImpl.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,30 @@
+/**
+ * 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 samples.userguide.sample3.server;
+
+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 java.lang.Integer echoInt(java.lang.Integer 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;
+//	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/LoggingHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/LoggingHandler.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/LoggingHandler.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/LoggingHandler.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.server;
+
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.handlers.AbstractHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class LoggingHandler extends AbstractHandler {
+
+	private Log log = LogFactory.getLog(getClass());
+	/* (non-Javadoc)
+	 * @see org.apache.axis.engine.Handler#invoke(org.apache.axis.context.MessageContext)
+	 */
+	
+	
+	
+	public void invoke(MessageContext msgContext) throws AxisFault {
+		log.info("Incomming message Frrom "+msgContext.getTo().getAddress());
+
+	}
+	
+	public void revoke(MessageContext msgContext){
+		log.info("Incomming message Revovked at the server "+msgContext.getTo().getAddress() );
+	}
+
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.server;
+
+import java.io.FileReader;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.AxisOperation;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.Flow;
+import org.apache.axis.description.FlowImpl;
+import org.apache.axis.description.SimpleAxisOperationImpl;
+import org.apache.axis.engine.EngineRegistry;
+import org.apache.axis.engine.EngineRegistryImpl;
+import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.om.SOAPEnvelope;
+import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis.testUtils.SimpleJavaProvider;
+import org.apache.axis.transport.http.SimpleHTTPReceiver;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class SampleEnvironmentCreator extends  AbstractTestCase{
+	
+    private Log log = LogFactory.getLog(getClass());
+    private QName serviceName = new QName("","sample3");
+    private QName operationName1 = new QName("http://localhost/my","echoInt");
+    private QName operationName2 = new QName("http://localhost/my","echoString");
+    private QName transportName = new QName("http://localhost/my","NullTransport");
+    private QName handlerName = new QName("http://localhost/my", "LoggingHandler");
+
+    private EngineRegistry engineRegistry;
+    private MessageContext mc;
+    private Thread thisThread = null;
+    private SimpleHTTPReceiver sas;
+    
+    public SampleEnvironmentCreator(){
+        super(SampleEnvironmentCreator.class.getName());
+//        try {
+//			this.setUp();
+//			this.testInt();
+//			this.tearDown();
+//		} catch (Exception e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+        
+    }
+
+    public SampleEnvironmentCreator(String testName) {
+        super(testName);
+    }
+    
+    public void setUp() throws Exception {
+        AxisGlobal global = new AxisGlobal();
+        
+        engineRegistry = new EngineRegistryImpl(global);
+        
+        AxisService service = new AxisService(serviceName);
+        Flow flow = new FlowImpl();
+        EngineUtils.addHandler(flow, new LoggingHandler());
+        service.setClassLoader(Thread.currentThread().getContextClassLoader());
+        service.setServiceClass(EchoImpl.class);
+        service.setProvider(new SimpleJavaProvider());
+        service.setInFlow(flow);
+
+        AxisOperation operation1 = new SimpleAxisOperationImpl(operationName1);
+        service.addOperation(operation1);
+        
+        AxisOperation operation2 = new SimpleAxisOperationImpl(operationName2);
+        service.addOperation(operation2);
+
+        EngineUtils.createExecutionChains(service);
+        engineRegistry.addService(service);
+        
+        sas = EngineUtils.startServer(engineRegistry);        
+    }
+    
+    
+    protected void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+}
+
+
+public void testInt() throws Exception{
+    try{
+   
+        Call call = new Call();
+        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+        EndpointReference epr = new EndpointReference(AddressingConstants.WSA_TO, url.toString());
+        call.setTo(epr);
+        SOAPEnvelope reply = call.sendReceive(this.getechoIntEnvelope());
+        reply.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+        
+    }catch(Exception e){
+        e.printStackTrace();
+        tearDown();
+        throw e;
+    }    
+}
+public void testString() throws Exception{
+//    try{
+//        OMFactory fac = OMFactory.newInstance();
+//
+//        OMNamespace omNs = fac.createOMNamespace("http://localhost/my","my");
+//        OMElement method =  fac.createOMElement("echoOMElement",omNs) ;
+//        OMElement value =  fac.createOMElement("myValue",omNs) ;
+//        value.setValue("Isaac Assimov, the foundation Sega");
+//        method.addChild(value);
+//        
+//        Call call = new Call();
+//        URL url = new URL("http","127.0.0.1",EngineUtils.TESTING_PORT,"/axis/services/EchoXMLService");
+//        
+//        CallBack callback = new CallBack() {
+//            public void doWork(OMElement ele) {
+//                System.out.print("got the result = " + ele +" :)");
+//
+//            }
+//            public void reportError(Exception e) {
+//                log.info("reporting error from callback !");
+//                e.printStackTrace();
+//            }
+//        };
+//        
+//        call.asyncCall(method,url,callback);
+//        log.info("send the reqest");
+//        
+//        Thread.sleep(1000);
+//    }catch(Exception e){
+//        e.printStackTrace();
+//        tearDown();
+//        throw e;
+//    }    
+}
+
+ public static void main(String[] args) {
+ 	new SampleEnvironmentCreator();
+	
+}
+
+private SOAPEnvelope getechoIntEnvelope() throws Exception {
+
+    SOAPEnvelope envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(
+            new FileReader(getTestResourceFile("echo/echoInt.xml")))).getSOAPEnvelope();
+    envelope.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), false);
+    return envelope;
+}
+	
+    
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/TestServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/TestServer.java?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/TestServer.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/TestServer.java Fri Feb 11 01:43:28 2005
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2001-2004 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.
+ */
+package samples.userguide.sample3.server;
+
+import org.apache.axis.engine.EngineUtils;
+
+/**
+ * @author chathura@opensource.lk
+ * 
+ */
+public class TestServer {
+
+	public static void main(String[] args) throws Exception {
+		
+		new SampleEnvironmentCreator().setUp();
+		Thread.sleep(300000);
+	}
+	
+	protected void tearDown() throws Exception {
+        EngineUtils.stopServer();    
+        Thread.sleep(1000);
+        System.out.println("Server shuting down......");
+	}
+}

Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/server.xml?view=auto&rev=153379
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/server.xml (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/server.xml Fri Feb 11 01:43:28 2005
@@ -0,0 +1,9 @@
+<server name ="AxisJava2.0" >
+    <phaseOrder>
+        <phase name="global"/>
+        <phase name="transport"/>
+        <phase name="Logging"/>
+        <phase name="service"/>
+    </phaseOrder>
+</server>
+