axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngalla...@apache.org
Subject svn commit: r471644 [2/2] - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/client/ src/org/apache/axis2/jaxws/client/async/ src/org/apache/axis2/jaxws/client/proxy/ src/org/apache/axis2/jaxws/core/ src/org/apache/axis2/jaxws...
Date Mon, 06 Nov 2006 05:55:29 GMT
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/ParamTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/ParamTests.java?view=diff&rev=471644&r1=471643&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/ParamTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/ParamTests.java Sun Nov  5 21:55:26 2006
@@ -1,18 +1,20 @@
 /*
- * Copyright 2006 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws.dispatch;
 

Copied: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SAXSourceDispatch.java (from r470019, webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SAXSourceDispatch.java?view=diff&rev=471644&p1=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java&r1=470019&p2=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SAXSourceDispatch.java&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SAXSourceDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SAXSourceDispatch.java Sun Nov  5 21:55:26 2006
@@ -1,20 +1,22 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws;
+package org.apache.axis2.jaxws.dispatch;
 
 import java.io.ByteArrayInputStream;
 import java.util.concurrent.Future;
@@ -24,6 +26,7 @@
 import javax.xml.transform.Source;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 
 import junit.framework.TestCase;
@@ -111,7 +114,6 @@
         System.out.println("---------------------------------------");
         System.out.println("test: " + getName());
         
-        
         // Initialize the JAX-WS client artifacts
         Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
         svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
@@ -119,7 +121,7 @@
                 Source.class, Service.Mode.PAYLOAD);
         
         // Setup the callback for async responses
-        CallbackHandler<Source> callbackHandler = new CallbackHandler<Source>();
+        AsyncCallback<Source> callbackHandler = new AsyncCallback<Source>();
         
         // Create a SAXSource out of the string content
         byte[] bytes = DispatchTestConstants.sampleBodyContent.getBytes();
@@ -134,6 +136,21 @@
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        Source response = callbackHandler.getValue();
+        assertNotNull("dispatch invoke returned null", response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(!responseText.contains("soap"));
+        assertTrue(!responseText.contains("Envelope"));
+        assertTrue(!responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
     }
     
     public void testAsyncCallbackMessageMode() throws Exception {
@@ -147,7 +164,7 @@
                 Source.class, Service.Mode.MESSAGE);
 		
         // Setup the callback for async responses
-        CallbackHandler<Source> callbackHandler = new CallbackHandler<Source>();
+        AsyncCallback<Source> callbackHandler = new AsyncCallback<Source>();
         
         // Create a SAXSource out of the string content
         byte[] bytes = DispatchTestConstants.sampleSoapMessage.getBytes();
@@ -162,7 +179,102 @@
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        Source response = callbackHandler.getValue();
+        assertNotNull("dispatch invoke returned null", response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(responseText.contains("soap"));
+        assertTrue(responseText.contains("Envelope"));
+        assertTrue(responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
 	}
+    
+    public void testAsyncPollingPayloadMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<Source> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, 
+                Source.class, Service.Mode.PAYLOAD);
+        
+        // Create a SAXSource out of the string content
+        byte[] bytes = DispatchTestConstants.sampleBodyContent.getBytes();
+        ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
+        InputSource input = new InputSource(stream);
+        Source request = new SAXSource(input);
+        
+        System.out.println(">> Invoking async (polling) Dispatch");
+        Response<Source> asyncResponse = dispatch.invokeAsync(request);
+
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        Source response = asyncResponse.get();
+        assertNotNull("dispatch invoke returned null", response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(!responseText.contains("soap"));
+        assertTrue(!responseText.contains("Envelope"));
+        assertTrue(!responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
+    }
+    
+    public void testAsyncPollingMessageMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<Source> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, 
+                Source.class, Service.Mode.MESSAGE);
+        
+        // Create a SAXSource out of the string content
+        byte[] bytes = DispatchTestConstants.sampleSoapMessage.getBytes();
+        ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
+        InputSource input = new InputSource(stream);
+        Source request = new SAXSource(input);
+        
+        System.out.println(">> Invoking async (callback) Dispatch");
+        Response<Source> asyncResponse = dispatch.invokeAsync(request);
+
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        Source response = asyncResponse.get();
+        assertNotNull("dispatch invoke returned null", response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(responseText.contains("soap"));
+        assertTrue(responseText.contains("Envelope"));
+        assertTrue(responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
+    }
     
     public void testOneWayPayloadMode() throws Exception {
         System.out.println("---------------------------------------");

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAP12Dispatch.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAP12Dispatch.java?view=diff&rev=471644&r1=471643&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAP12Dispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAP12Dispatch.java Sun Nov  5 21:55:26 2006
@@ -1,18 +1,20 @@
 /*
- * Copyright 2006 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws.dispatch;
 

Copied: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatch.java (from r470019, webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SOAPMessageDispatch.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatch.java?view=diff&rev=471644&p1=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SOAPMessageDispatch.java&r1=470019&p2=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatch.java&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/SOAPMessageDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatch.java Sun Nov  5 21:55:26 2006
@@ -1,20 +1,22 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws;
+package org.apache.axis2.jaxws.dispatch;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -24,6 +26,7 @@
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 import junit.framework.TestCase;
 
@@ -60,10 +63,9 @@
 
 		assertNotNull("dispatch invoke returned null", response);
 		response.writeTo(System.out);
-		System.out.println("-----------------------------------------");
 	}
 	
-	public void testSOAPMessageASyncCallbackMessageMode() throws Exception {
+	public void testSOAPMessageAsyncCallbackMessageMode() throws Exception {
 		
         String basedir = new File(".").getAbsolutePath();
         String messageResource = new File(basedir, this.messageResource).getAbsolutePath();
@@ -80,16 +82,54 @@
 		FileInputStream inputStream = new FileInputStream(messageResource);
 		MessageFactory factory = MessageFactory.newInstance();
 		SOAPMessage msgObject = factory.createMessage(null, inputStream);
-		CallbackHandler<SOAPMessage> ch = new CallbackHandler<SOAPMessage>();
+		
+        AsyncCallback<SOAPMessage> ac = new AsyncCallback<SOAPMessage>();
 		//Invoke the Dispatch
 		System.out.println(">> Invoking sync Dispatch");
-		Future<?> monitor = dispatch.invokeAsync(msgObject, ch);
+		Future<?> monitor = dispatch.invokeAsync(msgObject, ac);
 
 		assertNotNull("dispatch invokeAsync returned null Future<?>", monitor);
 		while (!monitor.isDone()) {
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        SOAPMessage response = ac.getValue();
+        assertNotNull("dispatch invoke returned null", response);
+        response.writeTo(System.out);
 	}
+    
+    public void testSOAPMessageAsyncPollingMessageMode() throws Exception {
+        
+        String basedir = new File(".").getAbsolutePath();
+        String messageResource = new File(basedir, this.messageResource).getAbsolutePath();
+        
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        //Initialize the JAX-WS client artifacts
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, null, url);
+        Dispatch<SOAPMessage> dispatch = svc.createDispatch(portName,
+                SOAPMessage.class, Service.Mode.MESSAGE);
+
+        //Create SOAPMessage Object no attachments here.
+        FileInputStream inputStream = new FileInputStream(messageResource);
+        MessageFactory factory = MessageFactory.newInstance();
+        SOAPMessage msgObject = factory.createMessage(null, inputStream);
+
+        //Invoke the Dispatch
+        System.out.println(">> Invoking sync Dispatch");
+        Response<SOAPMessage> asyncResponse = dispatch.invokeAsync(msgObject);
 
+        assertNotNull("dispatch invokeAsync returned null Response", asyncResponse);
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        SOAPMessage response = asyncResponse.get();
+        assertNotNull("dispatch invoke returned null", response);
+        response.writeTo(System.out);
+    }
+    
 }

Copied: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StreamSourceDispatch.java (from r470019, webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StreamSourceDispatch.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StreamSourceDispatch.java?view=diff&rev=471644&p1=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StreamSourceDispatch.java&r1=470019&p2=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StreamSourceDispatch.java&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StreamSourceDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StreamSourceDispatch.java Sun Nov  5 21:55:26 2006
@@ -1,20 +1,22 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws;
+package org.apache.axis2.jaxws.dispatch;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -25,6 +27,7 @@
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 import javax.xml.ws.Service.Mode;
 
@@ -62,7 +65,8 @@
         // Invoke the Dispatch<Source>
 		System.out.println(">> Invoking sync Dispatch with PAYLOAD mode");
 		Source response = dispatch.invoke(srcStream);
-
+		assertNotNull(response);
+        
         // Prepare the response content for checking
         XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
         Reader2Writer r2w = new Reader2Writer(reader);
@@ -96,6 +100,7 @@
         
         System.out.println(">> Invoking sync Dispatch with MESSAGE Mode");
 		StreamSource response = (StreamSource) dispatch.invoke(srcStream);
+        assertNotNull(response);
 
         // Prepare the response content for checking
         XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
@@ -124,7 +129,7 @@
                 Service.Mode.PAYLOAD);
         
         // We'll need a callback instance to handle the async responses
-        CallbackHandler<Source> callbackHandler = new CallbackHandler<Source>();
+        AsyncCallback<Source> callbackHandler = new AsyncCallback<Source>();
         
         // Create a StreamSource with the desired content
         byte[] bytes = DispatchTestConstants.sampleBodyContent.getBytes();
@@ -139,6 +144,21 @@
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        Source response = callbackHandler.getValue();
+        assertNotNull(response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(!responseText.contains("soap"));
+        assertTrue(!responseText.contains("Envelope"));
+        assertTrue(!responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
     }
     
     /**
@@ -155,7 +175,7 @@
                 Mode.MESSAGE);
         
         // We'll need a callback instance to handle the async responses
-        CallbackHandler<Source> callbackHandler = new CallbackHandler<Source>();
+        AsyncCallback<Source> callbackHandler = new AsyncCallback<Source>();
 
         // Create a StreamSource with the desired content
         byte[] bytes = DispatchTestConstants.sampleSoapMessage.getBytes();
@@ -170,8 +190,108 @@
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        Source response = callbackHandler.getValue();
+        assertNotNull(response);
+
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(responseText.contains("soap"));
+        assertTrue(responseText.contains("Envelope"));
+        assertTrue(responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
+    }
+
+    /**
+     * Invoke a Dispatch<Source> asynchronously with the content in PAYLOAD mode.
+     */
+    public void testAsyncPollingPayloadMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<Source> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, Source.class,
+                Service.Mode.PAYLOAD);
+        // Create a StreamSource with the desired content
+        byte[] bytes = DispatchTestConstants.sampleBodyContent.getBytes();
+        ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
+        Source srcStream = new StreamSource((InputStream) stream);
+
+        System.out.println(">> Invoking async (callback) Dispatch with PAYLOAD mode");
+        Response<Source> asyncResponse = dispatch.invokeAsync(srcStream);
+
+        // Wait for the async response to be returned
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        Source response = asyncResponse.get();
+        assertNotNull(response);
+        
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(!responseText.contains("soap"));
+        assertTrue(!responseText.contains("Envelope"));
+        assertTrue(!responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
     }
+    
+    /**
+     * Invoke a Dispatch<Source> asynchronously with the content in MESSAGE mode.
+     */
+    public void testAsyncPollingMessageMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts 
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<Source> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, Source.class,
+                Mode.MESSAGE);
 
+        // Create a StreamSource with the desired content
+        byte[] bytes = DispatchTestConstants.sampleSoapMessage.getBytes();
+        ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
+        Source srcStream = new StreamSource((InputStream) stream);
+        
+        System.out.println(">> Invoking async (callback) Dispatch with MESSAGE mode");
+        Response<Source> asyncResponse = dispatch.invokeAsync(srcStream);
+
+        // Wait for the async response to be returned
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        Source response = asyncResponse.get();
+        assertNotNull(response);
+
+        // Prepare the response content for checking
+        XMLStreamReader reader = inputFactory.createXMLStreamReader(response);
+        Reader2Writer r2w = new Reader2Writer(reader);
+        String responseText = r2w.getAsString();
+        System.out.println(responseText);
+        
+        // Check to make sure the content is correct
+        assertTrue(responseText.contains("soap"));
+        assertTrue(responseText.contains("Envelope"));
+        assertTrue(responseText.contains("Body"));
+        assertTrue(responseText.contains("echoStringResponse"));
+    }
+    
     /**
      * Invoke a Dispatch<Source> one-way operation
      */

Copied: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StringDispatch.java (from r470019, webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StringDispatch.java?view=diff&rev=471644&p1=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java&r1=470019&p2=webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StringDispatch.java&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/StringDispatch.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/dispatch/StringDispatch.java Sun Nov  5 21:55:26 2006
@@ -1,24 +1,27 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * 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
- *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *      
+ * 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 org.apache.axis2.jaxws;
+package org.apache.axis2.jaxws.dispatch;
 
 import java.util.concurrent.Future;
 
 import javax.xml.ws.Dispatch;
+import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 
 import junit.framework.TestCase;
@@ -93,15 +96,25 @@
                 String.class, Service.Mode.PAYLOAD);
 
         // Create the callback for async responses
-        CallbackHandler<String> callbackHandler = new CallbackHandler<String>();
+        AsyncCallback<String> callback = new AsyncCallback<String>();
         
         System.out.println(">> Invoking async (callback) Dispatch");
-        Future<?> monitor = dispatch.invokeAsync(DispatchTestConstants.sampleBodyContent, callbackHandler);
+        Future<?> monitor = dispatch.invokeAsync(DispatchTestConstants.sampleBodyContent, callback);
 	        
         while (!monitor.isDone()) {
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        String response = callback.getValue();
+        assertNotNull("dispatch invoke returned null", response);
+        System.out.println(response);
+        
+        // Check to make sure the content is correct
+        assertTrue(!response.contains("soap"));
+        assertTrue(!response.contains("Envelope"));
+        assertTrue(!response.contains("Body"));
+        assertTrue(response.contains("echoStringResponse"));
 	}
     
     /**
@@ -118,16 +131,90 @@
                 String.class, Service.Mode.MESSAGE);
 
         // Create the callback for async responses
-        CallbackHandler<String> callbackHandler = new CallbackHandler<String>();
+        AsyncCallback<String> callback = new AsyncCallback<String>();
         
         System.out.println(">> Invoking async (callback) Dispatch with Message Mode");
-        Future<?> monitor = dispatch.invokeAsync(DispatchTestConstants.sampleSoapMessage, callbackHandler);
+        Future<?> monitor = dispatch.invokeAsync(DispatchTestConstants.sampleSoapMessage, callback);
     
         while (!monitor.isDone()) {
             System.out.println(">> Async invocation still not complete");
             Thread.sleep(1000);
         }
+        
+        String response = callback.getValue();
+        assertNotNull("dispatch invoke returned null", response);
+        System.out.println(response);
+        
+        // Check to make sure the content is correct
+        assertTrue(response.contains("soap"));
+        assertTrue(response.contains("Envelope"));
+        assertTrue(response.contains("Body"));
+        assertTrue(response.contains("echoStringResponse"));
 	}
+    
+    /**
+     * Invoke a Dispatch<String> using the async polling API in PAYLOAD mode
+     */
+    public void testAsyncPollingPayloadMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<String> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, 
+                String.class, Service.Mode.PAYLOAD);
+
+        System.out.println(">> Invoking async (polling) Dispatch");
+        Response<String> asyncResponse = dispatch.invokeAsync(DispatchTestConstants.sampleBodyContent);
+            
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        String response = asyncResponse.get();
+        assertNotNull("dispatch invoke returned null", response);
+        System.out.println(response);
+        
+        // Check to make sure the content is correct
+        assertTrue(!response.contains("soap"));
+        assertTrue(!response.contains("Envelope"));
+        assertTrue(!response.contains("Body"));
+        assertTrue(response.contains("echoStringResponse"));
+    }
+    
+    /**
+     * Invoke a Dispatch<String> using the async polling API in MESSAGE mode
+     */
+    public void testAsyncPollingMessageMode() throws Exception {
+        System.out.println("---------------------------------------");
+        System.out.println("test: " + getName());
+        
+        // Initialize the JAX-WS client artifacts
+        Service svc = Service.create(DispatchTestConstants.QNAME_SERVICE);
+        svc.addPort(DispatchTestConstants.QNAME_PORT, null, DispatchTestConstants.URL);
+        Dispatch<String> dispatch = svc.createDispatch(DispatchTestConstants.QNAME_PORT, 
+                String.class, Service.Mode.MESSAGE);
+
+        System.out.println(">> Invoking async (polling) Dispatch with Message Mode");
+        Response<String> asyncResponse = dispatch.invokeAsync(DispatchTestConstants.sampleSoapMessage);
+    
+        while (!asyncResponse.isDone()) {
+            System.out.println(">> Async invocation still not complete");
+            Thread.sleep(1000);
+        }
+        
+        String response = asyncResponse.get();
+        assertNotNull("dispatch invoke returned null", response);
+        System.out.println(response);
+        
+        // Check to make sure the content is correct
+        assertTrue(response.contains("soap"));
+        assertTrue(response.contains("Envelope"));
+        assertTrue(response.contains("Body"));
+        assertTrue(response.contains("echoStringResponse"));
+    }
 	
     /**
      * Invoke a Dispatch<String> one-way in PAYLOAD mode 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=471644&r1=471643&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Sun Nov  5 21:55:26 2006
@@ -21,7 +21,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.axis2.jaxws.DispatchTestSuite;
 import org.apache.axis2.jaxws.attachments.MTOMSerializationTests;
 import org.apache.axis2.jaxws.description.AnnotationDescriptionTests;
 import org.apache.axis2.jaxws.description.AnnotationProviderImplDescriptionTests;
@@ -33,6 +32,7 @@
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderTests;
 import org.apache.axis2.jaxws.description.impl.ServiceDescriptionTests;
 import org.apache.axis2.jaxws.dispatch.SOAP12Dispatch;
+import org.apache.axis2.jaxws.dispatch.DispatchTestSuite;
 import org.apache.axis2.jaxws.exception.ExceptionFactoryTests;
 import org.apache.axis2.jaxws.handler.HandlerChainProcessorTests;
 import org.apache.axis2.jaxws.i18n.JaxwsMessageBundleTests;
@@ -51,6 +51,8 @@
 import org.apache.axis2.jaxws.provider.SourceProviderTests;
 import org.apache.axis2.jaxws.provider.StringMessageProviderTests;
 import org.apache.axis2.jaxws.provider.StringProviderTests;
+import org.apache.axis2.jaxws.proxy.ProxyNonWrappedTests;
+import org.apache.axis2.jaxws.proxy.ProxyTests;
 import org.apache.axis2.jaxws.sample.AddNumbersTests;
 import org.apache.axis2.jaxws.sample.AddressBookTests;
 import org.apache.axis2.jaxws.sample.FaultyWebServiceTests;
@@ -58,8 +60,6 @@
 import org.apache.axis2.jaxws.sample.NonWrapTests;
 import org.apache.axis2.jaxws.sample.WrapTests;
 import org.apache.axis2.jaxws.security.BasicAuthSecurityTests;
-import org.apache.axis2.proxy.ProxyNonWrappedTests;
-import org.apache.axis2.proxy.ProxyTests;
 import org.apache.log4j.BasicConfigurator;
 
 public class JAXWSTest extends TestCase {

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java?view=diff&rev=471644&r1=471643&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/source/SourceProvider.java Sun Nov  5 21:55:26 2006
@@ -20,16 +20,14 @@
 import java.io.InputStream;
 import java.io.StringWriter;
 
-import javax.xml.ws.Provider;
-import javax.xml.ws.WebServiceProvider;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-
-import org.apache.axis2.jaxws.DispatchTestConstants;
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceProvider;
 
 @WebServiceProvider()
 public class SourceProvider implements Provider<Source> {

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java?view=diff&rev=471644&r1=471643&r2=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/sourcemsg/SourceMessageProvider.java Sun Nov  5 21:55:26 2006
@@ -20,18 +20,16 @@
 import java.io.InputStream;
 import java.io.StringWriter;
 
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-
-import org.apache.axis2.jaxws.DispatchTestConstants;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
 
 @WebServiceProvider()
 @ServiceMode(value=Service.Mode.MESSAGE)

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/AsyncCallback.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/AsyncCallback.java?view=auto&rev=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/AsyncCallback.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/AsyncCallback.java Sun Nov  5 21:55:26 2006
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.axis2.jaxws.proxy;
+
+import java.util.concurrent.ExecutionException;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.test.proxy.doclitwrapped.ReturnType;
+
+/**
+ *
+ */
+public class AsyncCallback implements AsyncHandler {
+
+    public AsyncCallback() {
+        super();
+    }
+
+    /* (non-Javadoc)
+     * @see javax.xml.ws.AsyncHandler#handleResponse(javax.xml.ws.Response)
+     */
+    public void handleResponse(Response response) {
+        try{
+            Object obj = response.get();
+            if(obj instanceof ReturnType){
+                ReturnType type = (ReturnType)obj;
+                System.out.println(">>Return String = "+type.getReturnStr());
+                return;
+            }
+            if(obj instanceof org.test.proxy.doclitnonwrapped.ReturnType){
+                org.test.proxy.doclitnonwrapped.ReturnType returnType = (org.test.proxy.doclitnonwrapped.ReturnType)obj;
+                System.out.println(">>Return String = "+returnType.getReturnStr());
+                return;
+            }
+            System.out.println("Response.get should have been ReturnType" );
+            
+        }catch(ExecutionException e){
+            e.printStackTrace();
+        }catch(InterruptedException e){
+            e.printStackTrace();
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java?view=auto&rev=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyNonWrappedTests.java Sun Nov  5 21:55:26 2006
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.axis2.jaxws.proxy;
+
+import java.io.File;
+import java.net.URL;
+import java.util.concurrent.Future;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import org.apache.axis2.jaxws.proxy.doclitnonwrapped.sei.DocLitnonWrappedProxy;
+import org.apache.axis2.jaxws.proxy.doclitnonwrapped.sei.ProxyDocLitUnwrappedService;
+import org.test.proxy.doclitnonwrapped.Invoke;
+import org.test.proxy.doclitnonwrapped.ObjectFactory;
+import org.test.proxy.doclitnonwrapped.ReturnType;
+
+
+import junit.framework.TestCase;
+
+/**
+ * This test cases will use proxy NON wrapped wsdl to invoke methods
+ * on a deployed Server Endpoint.
+ */
+public class ProxyNonWrappedTests extends TestCase {
+
+    QName serviceName = new QName("http://doclitnonwrapped.proxy.test.org", "ProxyDocLitUnwrappedService");
+    private String axisEndpoint = "http://localhost:8080/axis2/services/ProxyDocLitUnwrappedService";
+    private QName portName = new QName("http://org.apache.axis2.proxy.doclitwrapped", "ProxyDocLitWrappedPort");
+    private String wsdlLocation = "test-resources/wsdl/ProxyDocLitnonWrapped.wsdl";
+    public ProxyNonWrappedTests() {
+        super();
+        // TODO Auto-generated constructor stub
+    }
+
+    /**
+     * @param arg0
+     */
+    public ProxyNonWrappedTests(String arg0) {
+        super(arg0);
+        // TODO Auto-generated constructor stub
+    }
+    
+    public void testInvoke(){
+        System.out.println("-----------------------------------");
+        System.out.println("test: " + getName());
+        System.out.println(">>Testing Sync Inovoke on Proxy DocLit non-wrapped");
+        ObjectFactory factory = new ObjectFactory();
+        Invoke invokeObj = factory.createInvoke();
+        invokeObj.setInvokeStr("test request for twoWay Operation");
+        Service service = Service.create(null, serviceName);
+        assertNotNull(service);
+        DocLitnonWrappedProxy proxy = service.getPort(portName, DocLitnonWrappedProxy.class);
+        assertNotNull(proxy);
+        BindingProvider p = (BindingProvider)proxy;
+        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+        ReturnType response = proxy.invoke(invokeObj);
+        assertNotNull(response);
+        System.out.println(">>Response =" +response.getReturnStr());
+        
+        System.out.println("-------------------------------------");
+    }
+    
+    public void testInvokeAsyncCallback(){
+        try{ 
+            System.out.println("---------------------------------------");
+            System.out.println("DocLitNonWrapped test case: " + getName());
+            //Create wsdl url
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            ObjectFactory factory = new ObjectFactory();
+            //create input object to web service operation
+            Invoke invokeObj = factory.createInvoke();
+            invokeObj.setInvokeStr("test request for twoWay Async Operation");
+            //Create Service
+            ProxyDocLitUnwrappedService service = new ProxyDocLitUnwrappedService(wsdlUrl, serviceName);
+            //Create proxy
+            DocLitnonWrappedProxy proxy = service.getProxyDocLitnonWrappedPort(); 
+            System.out.println(">>Invoking Binding Provider property");
+            //Setup Endpoint url -- optional.
+            BindingProvider p = (BindingProvider)proxy;
+                p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+            System.out.println(">> Invoking Proxy Asynchronous Callback");
+            AsyncHandler<ReturnType> handler = new AsyncCallback();
+            //Invoke operation Asynchronously.
+            Future<?> monitor = proxy.invokeAsync(invokeObj, handler);
+            while(!monitor.isDone()){
+                Thread.sleep(1000);
+            }
+            System.out.println("---------------------------------------");
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+    
+    public void testInvokeAsyncPolling(){
+        
+    }
+
+}
+

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyTests.java?view=auto&rev=471644
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/ProxyTests.java Sun Nov  5 21:55:26 2006
@@ -0,0 +1,280 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.axis2.jaxws.proxy;
+
+import java.io.File;
+import java.net.URL;
+import java.util.concurrent.Future;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Response;
+import javax.xml.ws.Service;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.jaxws.proxy.doclitwrapped.sei.DocLitWrappedProxy;
+import org.apache.axis2.jaxws.proxy.doclitwrapped.sei.ProxyDocLitWrappedService;
+import org.test.proxy.doclitwrapped.ReturnType;
+
+public class ProxyTests extends TestCase {
+    private QName serviceName = new QName(
+            "http://org.apache.axis2.proxy.doclitwrapped", "ProxyDocLitWrappedService");
+    private String axisEndpoint = "http://localhost:8080/axis2/services/ProxyDocLitWrappedService";
+    private QName portName = new QName("http://org.apache.axis2.proxy.doclitwrapped",
+            "ProxyDocLitWrappedPort");
+    private String wsdlLocation = "test/org/apache/axis2/jaxws/proxy/doclitwrapped/META-INF/ProxyDocLitWrapped.wsdl";
+    private boolean runningOnAxis = true;
+    
+    public void testMultipleServiceCalls(){
+        try{
+            if(!runningOnAxis){
+                return;
+            }
+            System.out.println("---------------------------------------");
+            System.out.println("test:" +getName());
+            String request = new String("some string request");
+            System.out.println("Service Call #1");
+            ProxyDocLitWrappedService service1 = new ProxyDocLitWrappedService();
+            DocLitWrappedProxy proxy1 = service1.getProxyDocLitWrappedPort();
+            BindingProvider p1 =    (BindingProvider)proxy1;
+            p1.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+            String response1 = proxy1.invoke(request);
+            System.out.println("Proxy Response =" + response1);
+            System.out.println("---------------------------------------");
+            
+            System.out.println("Service Call #2");
+            ProxyDocLitWrappedService service2 = new ProxyDocLitWrappedService();
+            DocLitWrappedProxy proxy2 = service2.getProxyDocLitWrappedPort();
+            BindingProvider p2 =    (BindingProvider)proxy2;
+            p2.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+            String response2 = proxy2.invoke(request);
+            System.out.println("Proxy Response =" + response2);
+            System.out.println("---------------------------------------");
+            
+        }catch(Exception e){
+            //fail(getName() + " failed");
+            e.printStackTrace();
+        }
+    }
+    
+    public void testInvokeWithNullParam(){
+        try{ 
+            if(!runningOnAxis){
+                return;
+            }
+            System.out.println("---------------------------------------");
+            System.out.println("Test Name: "+getName());
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName); 
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class);
+            System.out.println(">>Invoking Binding Provider property");
+            BindingProvider p = (BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
+            System.out.println(">> Invoking Proxy Synchronously");
+            String request = null;
+            String response = dwp.invoke(request);
+            System.out.println("Proxy Response =" + response);
+            System.out.println("---------------------------------------");
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+    public void testInvoke(){
+        try{ 
+            if(!runningOnAxis){
+                return;
+            }
+            System.out.println("---------------------------------------");
+            
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName);
+            String request = new String("some string request"); 
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class);
+            System.out.println(">>Invoking Binding Provider property");
+            BindingProvider p = (BindingProvider)proxy;
+                p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+                
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
+            System.out.println(">> Invoking Proxy Synchronously");
+            String response = dwp.invoke(request);
+            System.out.println("Proxy Response =" + response);
+            System.out.println("---------------------------------------");
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+
+    public void testInvokeWithWSDL(){
+        try{ 
+            if(!runningOnAxis){
+                return;
+            }
+            System.out.println("---------------------------------------");
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(wsdlUrl, serviceName);
+            String request = new String("some string request"); 
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class);
+            System.out.println(">>Invoking Binding Provider property");
+            BindingProvider p = (BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+                
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
+            System.out.println(">> Invoking Proxy Synchronously");
+            String response = dwp.invoke(request);
+            System.out.println("Proxy Response =" + response);
+            System.out.println("---------------------------------------");
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+    
+    public void testInvokeAsyncCallback(){
+        try{ 
+            if(!runningOnAxis){
+                return;
+            }
+            System.out.println("---------------------------------------");
+            
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName);
+            String request = new String("some string request"); 
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class);
+            System.out.println(">>Invoking Binding Provider property");
+            BindingProvider p = (BindingProvider)proxy;
+                p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+                
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
+            System.out.println(">> Invoking Proxy Asynchronous Callback");
+            AsyncHandler handler = new AsyncCallback();
+            Future<?> response = dwp.invokeAsync(request, handler);
+            System.out.println("---------------------------------------");
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+    
+    public void testInvokeAsyncPolling() {
+        try { 
+            System.out.println("---------------------------------------");
+            
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName);
+            DocLitWrappedProxy proxy =service.getPort(portName, DocLitWrappedProxy.class);
+            
+            String request = new String("some string request"); 
+            
+            System.out.println(">> Invoking Binding Provider property");
+            BindingProvider p = (BindingProvider) proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+                
+            System.out.println(">> Invoking Proxy with async polling request");
+            Response<ReturnType> asyncResponse = proxy.invokeAsync(request);
+
+            while (!asyncResponse.isDone()) {
+                System.out.println(">> Async invocation still not complete");
+                Thread.sleep(1000);
+            }
+            
+            ReturnType response = asyncResponse.get();
+            assertNotNull(response);
+        }
+        catch(Exception e) { 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+    }
+    
+    public void testTwoWay(){
+        /*
+        try{ 
+            if(runningOnAxis){
+                return;
+            }
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName);
+            String request = new String("some string request"); 
+            
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class); 
+            BindingProvider p = (BindingProvider)proxy;
+            p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,wasEndpoint);
+                
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;  
+            String response = dwp.twoWay(request);
+            System.out.println("Response =" + response);
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+        */
+    }
+    
+    public void testOneWay(){
+        
+    }
+    
+    public void testHolder(){
+        
+    }
+    
+    public void testTwoWayAsyncCallback(){
+        /*
+        try{ 
+            if(runningOnAxis){
+                return;
+            }
+            File wsdl= new File(wsdlLocation); 
+            URL wsdlUrl = wsdl.toURL(); 
+            Service service = Service.create(null, serviceName);
+            
+            String request = new String("some string request"); 
+            
+            Object proxy =service.getPort(portName, DocLitWrappedProxy.class); 
+            BindingProvider p = (BindingProvider)proxy;
+                p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,wasEndpoint);
+                
+            DocLitWrappedProxy dwp = (DocLitWrappedProxy)proxy;
+            AsyncHandler handler = new AsyncCallback();
+            Future<?> response = dwp.twoWayAsync(request, handler);
+            
+        }catch(Exception e){ 
+            e.printStackTrace(); 
+            fail("Exception received" + e);
+        }
+        */
+    }
+    
+    public void testAsyncPooling(){
+        
+    }
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message