axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r639676 - in /webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples: client/ client/echo/ client/ping/ servlet/
Date Fri, 21 Mar 2008 15:46:43 GMT
Author: dims
Date: Fri Mar 21 08:46:37 2008
New Revision: 639676

URL: http://svn.apache.org/viewvc?rev=639676&view=rev
Log:
Get Asynchronous Echo with Sync Communication working with both SOAP11 and SOAP12

Modified:
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/SampleClient.java
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoService12PortProxy.java
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoServicePortProxy.java
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingService12PortProxy.java
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingServicePortProxy.java
    webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/servlet/EchoPingSampleServlet.java

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/SampleClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/SampleClient.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/SampleClient.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/SampleClient.java
Fri Mar 21 08:46:37 2008
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import java.util.concurrent.Future;
+import java.net.URL;
 
 /**
  * SampleClient
@@ -188,34 +189,34 @@
                     if (0 == urlSuffix.length()) {
                         urlSuffix = ECHO_CONTEXT12;
                     }
-                    buildEcho12(uriString + urlSuffix, message);
+                    buildEcho12(uriString + urlSuffix, null, message);
                 } else if (servtype.equalsIgnoreCase("async")) {
                     if (0 == urlSuffix.length()) {
                         urlSuffix = ECHO_CONTEXT12;
                     }
-                    buildAsync12(uriString + urlSuffix, message, timeout, wireasync);
+                    buildAsync12(uriString + urlSuffix, null, message, timeout, wireasync);
                 } else {
                     if (0 == urlSuffix.length()) {
                         urlSuffix = PING_CONTEXT12;
                     }
-                    buildPing12(uriString + urlSuffix, message);
+                    buildPing12(uriString + urlSuffix, null, message);
                 }
             } else {
                 if (servtype.equalsIgnoreCase("echo")) {
                     if (0 == urlSuffix.length()) {
                         urlSuffix = ECHO_CONTEXT;
                     }
-                    buildEcho(uriString + urlSuffix, message);
+                    buildEcho(uriString + urlSuffix, null, message);
                 } else if (servtype.equalsIgnoreCase("async")) {
                     if (0 == urlSuffix.length()) {
                         urlSuffix = ECHO_CONTEXT;
                     }
-                    buildAsync(uriString + urlSuffix, message, timeout, wireasync);
+                    buildAsync(uriString + urlSuffix, null, message, timeout, wireasync);
                 } else {
                     if (0 == urlSuffix.length()) {
                         urlSuffix = PING_CONTEXT;
                     }
-                    buildPing(uriString + urlSuffix, message);
+                    buildPing(uriString + urlSuffix, null, message);
                 }
             }
         }
@@ -229,9 +230,9 @@
      * @param input       The message string
      * @return Boolean true if the ping works
      */
-    public boolean buildPing(String endpointURL, String input) {
+    public boolean buildPing(String endpointURL, URL wsdlURL, String input) {
         try {
-            PingServicePortProxy ping = new PingServicePortProxy(null, new QName("http://org/apache/axis2/jaxws/samples/ping/",
"PingService"));
+            PingServicePortProxy ping = new PingServicePortProxy(wsdlURL);
             ping._getDescriptor().setEndpoint(endpointURL);
             System.out.println(">> CLIENT: SEI Ping to " + endpointURL);
 
@@ -269,10 +270,10 @@
      * @param input       The message string
      * @return String from the service
      */
-    public String buildEcho(String endpointURL, String input) {
+    public String buildEcho(String endpointURL, URL wsdlURL, String input) {
         String response = "ERROR!:";
         try {
-            EchoServicePortProxy echo = new EchoServicePortProxy(null, new QName("http://org/apache/axis2/jaxws/samples/echo/",
"EchoService"));
+            EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
             echo._getDescriptor().setEndpoint(endpointURL);
 
             // Configure SOAPAction properties
@@ -313,10 +314,10 @@
      * @param wireasync   true to use Async on the wire
      * @return String from the service
      */
-    public String buildAsync(String endpointURL, String input, int waiting, Boolean wireasync)
{
+    public String buildAsync(String endpointURL, URL wsdlURL, String input, int waiting,
Boolean wireasync) {
         String response = "ERROR!:";
         try {
-            EchoServicePortProxy echo = new EchoServicePortProxy(null, new QName("http://org/apache/axis2/jaxws/samples/echo/",
"EchoService"));
+            EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
             echo._getDescriptor().setEndpoint(endpointURL);
 
             // Configure SOAPAction properties
@@ -381,9 +382,9 @@
      * @param input       The message string
      * @return Boolean true if the ping works
      */
-    public boolean buildPing12(String endpointURL, String input) {
+    public boolean buildPing12(String endpointURL, URL wsdlURL, String input) {
         try {
-            PingService12PortProxy ping = new PingService12PortProxy();
+            PingService12PortProxy ping = new PingService12PortProxy(wsdlURL);
             ping._getDescriptor().setEndpoint(endpointURL);
             System.out.println(">> CLIENT: SEI Ping to " + endpointURL);
 
@@ -411,10 +412,10 @@
      * @param input       The message string
      * @return String from the service
      */
-    public String buildEcho12(String endpointURL, String input) {
+    public String buildEcho12(String endpointURL, URL wsdlURL, String input) {
         String response = "ERROR!:";
         try {
-            EchoService12PortProxy echo = new EchoService12PortProxy();
+            EchoService12PortProxy echo = new EchoService12PortProxy(wsdlURL);
             echo._getDescriptor().setEndpoint(endpointURL);
 
             // Build the input object
@@ -447,10 +448,10 @@
      * @param wireasync   true to use Async on the wire
      * @return String from the service
      */
-    public String buildAsync12(String endpointURL, String input, int waiting, Boolean wireasync)
{
+    public String buildAsync12(String endpointURL, URL wsdlURL, String input, int waiting,
Boolean wireasync) {
         String response = "ERROR!:";
         try {
-            EchoService12PortProxy echo = new EchoService12PortProxy();
+            EchoService12PortProxy echo = new EchoService12PortProxy(wsdlURL);
             echo._getDescriptor().setEndpoint(endpointURL);
 
             // Configure over-the-wire async if specified

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoService12PortProxy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoService12PortProxy.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoService12PortProxy.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoService12PortProxy.java
Fri Mar 21 08:46:37 2008
@@ -92,6 +92,10 @@
         _descriptor = new Descriptor();
     }
 
+    public EchoService12PortProxy(URL wsdlLocation) {
+        _descriptor = new Descriptor(wsdlLocation, new QName("http://org/apache/axis2/jaxws/samples/echo/",
"EchoService12"));
+    }
+
     public EchoService12PortProxy(URL wsdlLocation, QName serviceName) {
         _descriptor = new Descriptor(wsdlLocation, serviceName);
     }

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoServicePortProxy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoServicePortProxy.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoServicePortProxy.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/echo/EchoServicePortProxy.java
Fri Mar 21 08:46:37 2008
@@ -92,6 +92,10 @@
         _descriptor = new Descriptor();
     }
 
+    public EchoServicePortProxy(URL wsdlLocation) {
+        _descriptor = new Descriptor(wsdlLocation, new QName("http://org/apache/axis2/jaxws/samples/echo/",
"EchoService"));
+    }
+
     public EchoServicePortProxy(URL wsdlLocation, QName serviceName) {
         _descriptor = new Descriptor(wsdlLocation, serviceName);
     }

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingService12PortProxy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingService12PortProxy.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingService12PortProxy.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingService12PortProxy.java
Fri Mar 21 08:46:37 2008
@@ -88,6 +88,10 @@
         _descriptor = new Descriptor();
     }
 
+    public PingService12PortProxy(URL wsdlLocation) {
+        _descriptor = new Descriptor(wsdlLocation, new QName("http://org/apache/axis2/jaxws/samples/ping/",
"PingService12"));
+    }
+
     public PingService12PortProxy(URL wsdlLocation, QName serviceName) {
         _descriptor = new Descriptor(wsdlLocation, serviceName);
     }

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingServicePortProxy.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingServicePortProxy.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingServicePortProxy.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/client/ping/PingServicePortProxy.java
Fri Mar 21 08:46:37 2008
@@ -88,6 +88,10 @@
         _descriptor = new Descriptor();
     }
 
+    public PingServicePortProxy(URL wsdlLocation) {
+        _descriptor = new Descriptor(wsdlLocation, new QName("http://org/apache/axis2/jaxws/samples/ping/",
"PingService"));
+    }
+
     public PingServicePortProxy(URL wsdlLocation, QName serviceName) {
         _descriptor = new Descriptor(wsdlLocation, serviceName);
     }

Modified: webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/servlet/EchoPingSampleServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/servlet/EchoPingSampleServlet.java?rev=639676&r1=639675&r2=639676&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/servlet/EchoPingSampleServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/jaxws-samples/src/main/org/apache/axis2/jaxws/samples/servlet/EchoPingSampleServlet.java
Fri Mar 21 08:46:37 2008
@@ -27,6 +27,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.net.URL;
+import java.net.MalformedURLException;
 
 /**
  * EchoPingSampleServlet main entry point for JSP servlet
@@ -119,15 +121,15 @@
                 System.out.println(">> SERVLET: Request index: " + (index + 1));
                 if (0 == soapString.length()) {
                     if (svc.equalsIgnoreCase(("Async"))) {
-                        result += client.buildAsync(uriString + ECHO_CONTEXT, msgString,
+                        result += client.buildAsync(uriString + ECHO_CONTEXT, getWSDLURL("/WEB-INF/wsdl/Echo.wsdl"),
msgString,
                                 TIMEOUT, false);
                     } else if (svc.equalsIgnoreCase(("AsyncWire"))) {
-                        result += client.buildAsync(uriString + ECHO_CONTEXT, msgString,
+                        result += client.buildAsync(uriString + ECHO_CONTEXT, getWSDLURL("/WEB-INF/wsdl/Echo.wsdl"),
msgString,
                                 TIMEOUT, true);
                     } else if (svc.equalsIgnoreCase("Echo")) {
-                        result += client.buildEcho(uriString + ECHO_CONTEXT, msgString);
+                        result += client.buildEcho(uriString + ECHO_CONTEXT, getWSDLURL("/WEB-INF/wsdl/Echo.wsdl"),
msgString);
                     } else {
-                        if (client.buildPing(uriString + PING_CONTEXT, msgString)) {
+                        if (client.buildPing(uriString + PING_CONTEXT, getWSDLURL("/WEB-INF/wsdl/Ping.wsdl"),
msgString)) {
                             result += PING_RESPONSE_GOOD;
                         } else {
                             result += PING_RESPONSE_BAD;
@@ -136,15 +138,15 @@
                 } else  // SOAP1.2
                 {
                     if (svc.equalsIgnoreCase(("Async"))) {
-                        result += client.buildAsync12(uriString + ECHO_CONTEXT12, msgString,
+                        result += client.buildAsync12(uriString + ECHO_CONTEXT12, getWSDLURL("/WEB-INF/wsdl/Echo12.wsdl"),
msgString,
                                 TIMEOUT, false);
                     } else if (svc.equalsIgnoreCase(("AsyncWire"))) {
-                        result += client.buildAsync12(uriString + ECHO_CONTEXT12, msgString,
+                        result += client.buildAsync12(uriString + ECHO_CONTEXT12, getWSDLURL("/WEB-INF/wsdl/Echo12.wsdl"),
msgString,
                                 TIMEOUT, true);
                     } else if (svc.equalsIgnoreCase("Echo")) {
-                        result += client.buildEcho12(uriString + ECHO_CONTEXT12, msgString);
+                        result += client.buildEcho12(uriString + ECHO_CONTEXT12, getWSDLURL("/WEB-INF/wsdl/Echo12.wsdl"),
msgString);
                     } else {
-                        if (client.buildPing12(uriString + PING_CONTEXT12, msgString)) {
+                        if (client.buildPing12(uriString + PING_CONTEXT12, getWSDLURL("/WEB-INF/wsdl/Ping12.wsdl"),
msgString)) {
                             result += PING_RESPONSE_GOOD;
                         } else {
                             result += PING_RESPONSE_BAD;
@@ -171,4 +173,7 @@
                 + "\n");
     }
 
+    private URL getWSDLURL(String file) throws MalformedURLException {
+        return getServletConfig().getServletContext().getResource(file);
+    }
 }



---------------------------------------------------------------------
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