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/15 09:40:34 UTC
svn commit: r153921 - in
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3:
build.xml src/META-INF/ src/samples/userguide/sample3/client/EchoInt.java
src/samples/userguide/sample3/client/InteropTest_Stub.java
src/samples/userguide/sample3/server/SampleEnvironmentCreator.java
Author: chathura
Date: Tue Feb 15 00:40:31 2005
New Revision: 153921
URL: http://svn.apache.org/viewcvs?view=rev&rev=153921
Log:
Sample 3 completed with Hot deployment
Removed:
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/META-INF/
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml
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/InteropTest_Stub.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java
Modified: 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=diff&r1=153920&r2=153921
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/build.xml Tue Feb 15 00:40:31 2005
@@ -50,11 +50,11 @@
</target>
<target name="validateSevices.dir">
- <available file="${env.CATALINA_HOME}/webapps/axis2/services" type="dir" property="axis2.services"/>
+ <available file="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/services" type="dir" property="axis2.services"/>
</target>
<target name="validateDeploymentSettings" depends="validateTomcatHome" unless="validateSevices.dir">
- <mkdir dir="${env.CATALINA_HOME}/webapps/axis2/services"/>
+ <mkdir dir="${env.CATALINA_HOME}/webapps/axis2/WEB-INF/services"/>
</target>
Modified: 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=diff&r1=153920&r2=153921
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/EchoInt.java Tue Feb 15 00:40:31 2005
@@ -19,7 +19,6 @@
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
-import org.apache.axis.engine.EngineUtils;
/**
* @author chathura@opensource.lk
Modified: 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=diff&r1=153920&r2=153921
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/client/InteropTest_Stub.java Tue Feb 15 00:40:31 2005
@@ -117,6 +117,9 @@
Iterator childrenIter = body.getChildren();
while(childrenIter.hasNext()){
OMNode child = (OMNode) childrenIter.next();
+ if(child instanceof OMElement && "Fault".equalsIgnoreCase(((OMElement)child).getLocalName())){
+ throw new AxisFault("Fault in server side");
+ }
if(child instanceof OMElement && "echoStringResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
response = (OMElement)child;
}
@@ -143,6 +146,9 @@
Iterator childrenIter = body.getChildren();
while(childrenIter.hasNext()){
OMNode child = (OMNode) childrenIter.next();
+ if(child instanceof OMElement && "Fault".equalsIgnoreCase(((OMElement)child).getLocalName())){
+ throw new AxisFault("Fault in server side");
+ }
if(child instanceof OMElement && "echoIntResponse".equalsIgnoreCase(((OMElement)child).getLocalName())){
response = (OMElement)child;
}
Modified: 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=diff&r1=153920&r2=153921
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/userguide/sample3/src/samples/userguide/sample3/server/SampleEnvironmentCreator.java Tue Feb 15 00:40:31 2005
@@ -15,17 +15,8 @@
*/
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;
@@ -36,8 +27,6 @@
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;
@@ -47,7 +36,7 @@
* @author chathura@opensource.lk
*
*/
-public class SampleEnvironmentCreator extends AbstractTestCase{
+public class SampleEnvironmentCreator {
private Log log = LogFactory.getLog(getClass());
private QName serviceName = new QName("","sample3");
@@ -61,22 +50,9 @@
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();
@@ -110,69 +86,7 @@
}
-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;
-}
-
}