[jbossws-commits] JBossWS SVN: r15478 - in shared-testsuite/trunk/testsuite/src/test: java/org/jboss/test/ws/publish and 6 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jan 4 08:35:32 EST 2012


Author: alessio.soldano at jboss.com
Date: 2012-01-04 08:35:31 -0500 (Wed, 04 Jan 2012)
New Revision: 15478

Added:
   shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl3.java
   shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/
   shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/
   shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml
   shared-testsuite/trunk/testsuite/src/test/resources/publish/
   shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/
   shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/
   shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/EndpointImpl3.xml
Modified:
   shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
   shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
Log:
Adding @WebServiceProvider based example to the testcase for EndpointPublisherService


Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml	2012-01-02 13:10:05 UTC (rev 15477)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml	2012-01-04 13:35:31 UTC (rev 15478)
@@ -502,9 +502,15 @@
     <!-- endpoint-publish.war -->  	
     <war warfile="${tests.output.dir}/test-libs/endpoint-publish.war" needxmlfile='false'>
       <classes dir="${tests.output.dir}/test-classes">
-        <include name="org/jboss/test/ws/publish/**"/>
+        <include name="org/jboss/test/ws/publish/**/*.class"/>
         <exclude name="org/jboss/test/ws/publish/*TestCase.class"/>
       </classes>
+      <classes dir="${tests.output.dir}/test-classes/org/jboss/test/ws/publish">
+        <include name="WEB-INF/wsdl/**" />
+      </classes>
+      <webinf dir="${tests.output.dir}/test-resources/publish/WEB-INF">
+      	<include name="wsdl/**"/>
+      </webinf>
     </war>
   	
     <!-- management-recording-as7.jar -->

Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl3.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl3.java	                        (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl3.java	2012-01-04 13:35:31 UTC (rev 15478)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.publish;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.logging.Logger;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+ at WebServiceProvider(serviceName="EndpointService3",
+      portName="EndpointPort",
+      targetNamespace = "http://publish.ws.test.jboss.org/",
+      wsdlLocation = "./WEB-INF/wsdl/EndpointImpl3.xml")
+ at ServiceMode(value = Service.Mode.MESSAGE)
+public class EndpointImpl3 implements Provider<SOAPMessage>
+{
+   // Provide logging
+   private static Logger log = Logger.getLogger(EndpointImpl3.class);
+
+   public SOAPMessage invoke(SOAPMessage request)
+   {
+      log.info("echo (3): " + request);
+      try {
+         SOAPBody sb = request.getSOAPBody();
+         NodeList nl = sb.getElementsByTagName("arg0");
+         if (nl.getLength() != 1) {
+            throw new IllegalArgumentException("Unexpected input!");
+         }
+         Node ret = sb.getOwnerDocument().createElement("return");
+         Node arg0 = nl.item(0);
+         ret.appendChild(arg0.getFirstChild().cloneNode(true));
+         Node parent = arg0.getParentNode();
+         parent.removeChild(arg0);
+         parent.appendChild(ret);
+      } catch (Exception e) {
+         throw new RuntimeException(e);
+      }
+      return request;
+   }
+}

Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java	2012-01-02 13:10:05 UTC (rev 15477)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java	2012-01-04 13:35:31 UTC (rev 15478)
@@ -73,6 +73,7 @@
          Map<String,String> map = new HashMap<String, String>();
          map.put("/pattern", "org.jboss.test.ws.publish.EndpointImpl");
          map.put("/pattern2", "org.jboss.test.ws.publish.EndpointImpl2");
+         map.put("/pattern3", "org.jboss.test.ws.publish.EndpointImpl3");
          
          ctx = publisher.publish("ep-publish-test", Thread.currentThread().getContextClassLoader(), map);
          for (Endpoint ep : ctx.getEndpoints()) {
@@ -84,6 +85,7 @@
          //call endpoint
          invoke(new URL("http://localhost:8080/ep-publish-test/pattern?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService"));
          invoke(new URL("http://localhost:8080/ep-publish-test/pattern2?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService2"));
+         invoke(new URL("http://localhost:8080/ep-publish-test/pattern3?wsdl"), new QName("http://publish.ws.test.jboss.org/", "EndpointService3"));
          
          res.getWriter().print("1");
       }

Added: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml	                        (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml	2012-01-04 13:35:31 UTC (rev 15478)
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="EndpointService3" targetNamespace="http://publish.ws.test.jboss.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://publish.ws.test.jboss.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:message name="echoStringResponse">
+    <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="echoString">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Endpoint">
+    <wsdl:operation name="echoString">
+      <wsdl:input message="tns:echoString" name="echoString">
+    </wsdl:input>
+      <wsdl:output message="tns:echoStringResponse" name="echoStringResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="EndpointService3SoapBinding" type="tns:Endpoint">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="echoString">
+      <soap:operation soapAction="urn:EchoString" style="rpc"/>
+      <wsdl:input name="echoString">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="echoStringResponse">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="EndpointService3">
+    <wsdl:port binding="tns:EndpointService3SoapBinding" name="EndpointPort">
+      <soap:address location="http://localhost:8080/ep-publish-test/pattern3"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/EndpointImpl3.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/EndpointImpl3.xml	                        (rev 0)
+++ shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/EndpointImpl3.xml	2012-01-04 13:35:31 UTC (rev 15478)
@@ -0,0 +1,35 @@
+<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="EndpointService3" targetNamespace="http://publish.ws.test.jboss.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://publish.ws.test.jboss.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:message name="echoStringResponse">
+    <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="echoString">
+    <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="Endpoint">
+    <wsdl:operation name="echoString">
+      <wsdl:input message="tns:echoString" name="echoString">
+    </wsdl:input>
+      <wsdl:output message="tns:echoStringResponse" name="echoStringResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="EndpointService3SoapBinding" type="tns:Endpoint">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="echoString">
+      <soap:operation soapAction="urn:EchoString" style="rpc"/>
+      <wsdl:input name="echoString">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="echoStringResponse">
+        <soap:body namespace="http://publish.ws.test.jboss.org/" use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="EndpointService3">
+    <wsdl:port binding="tns:EndpointService3SoapBinding" name="EndpointPort">
+      <soap:address location="http://localhost:8080/ep-publish-test/pattern3"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file



More information about the jbossws-commits mailing list