Author: alessio.soldano(a)jboss.com
Date: 2012-01-18 08:16:19 -0500 (Wed, 18 Jan 2012)
New Revision: 15496
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl4.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
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/EndpointPublishServlet.java
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/WEB-INF/wsdl/EndpointImpl3.xml
Log:
[AS7-3324] Extending testcase
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java 2012-01-18
13:14:06 UTC (rev 15495)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl2.java 2012-01-18
13:16:19 UTC (rev 15496)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
-@WebService(serviceName="EndpointService2", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
+@WebService(serviceName="EndpointService2", portName="EndpointPort2",
endpointInterface = "org.jboss.test.ws.publish.Endpoint")
public class EndpointImpl2
{
// Provide logging
Modified:
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 2012-01-18
13:14:06 UTC (rev 15495)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl3.java 2012-01-18
13:16:19 UTC (rev 15496)
@@ -33,7 +33,7 @@
import org.w3c.dom.NodeList;
@WebServiceProvider(serviceName="EndpointService3",
- portName="EndpointPort",
+ portName="EndpointPort3",
targetNamespace = "http://publish.ws.test.jboss.org/",
wsdlLocation = "./WEB-INF/wsdl/EndpointImpl3.xml")
@ServiceMode(value = Service.Mode.MESSAGE)
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl4.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl4.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl4.java 2012-01-18
13:16:19 UTC (rev 15496)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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;
+
+@WebServiceProvider
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class EndpointImpl4 implements Provider<SOAPMessage>
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl4.class);
+
+ public SOAPMessage invoke(SOAPMessage request)
+ {
+ log.info("echo (4): " + 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-18
13:14:06 UTC (rev 15495)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2012-01-18
13:16:19 UTC (rev 15496)
@@ -43,6 +43,9 @@
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
+import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
import org.jboss.wsf.spi.publish.Context;
import org.jboss.wsf.spi.publish.EndpointPublisher;
import org.jboss.wsf.spi.publish.EndpointPublisherFactory;
@@ -74,8 +77,10 @@
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");
+ map.put("/pattern4",
"org.jboss.test.ws.publish.EndpointImpl4");
- ctx = publisher.publish("ep-publish-test",
Thread.currentThread().getContextClassLoader(), map);
+ ctx = publisher.publish("ep-publish-test",
Thread.currentThread().getContextClassLoader(), map, createMetaData());
+
for (Endpoint ep : ctx.getEndpoints()) {
System.out.println("State: " + ep.getState());
System.out.println("Address: " + ep.getAddress());
@@ -86,6 +91,7 @@
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"));
+ invoke(new URL("http://localhost:8080/ep-publish-test/pattern4?wsdl"),
new
QName("http://publish.ws.test.jboss.org/", "EndpointService4"));
res.getWriter().print("1");
}
@@ -112,6 +118,20 @@
}
}
+ private WebservicesMetaData createMetaData() {
+ WebservicesMetaData metadata = new WebservicesMetaData();
+ WebserviceDescriptionMetaData webserviceDescription = new
WebserviceDescriptionMetaData(metadata);
+ metadata.addWebserviceDescription(webserviceDescription);
+ webserviceDescription.setWsdlFile("WEB-INF/wsdl/EndpointImpl4.xml");
+ PortComponentMetaData portComponent = new
PortComponentMetaData(webserviceDescription);
+ portComponent.setPortComponentName("PortComponent4"); //unique ID
+
portComponent.setServiceEndpointInterface("org.jboss.test.ws.publish.EndpointImpl4");
+ portComponent.setWsdlPort(new
QName("http://publish.ws.test.jboss.org/",
"EndpointPort4"));
+ portComponent.setWsdlService(new
QName("http://publish.ws.test.jboss.org/", "EndpointService4"));
+ webserviceDescription.addPortComponent(portComponent);
+ return metadata;
+ }
+
private static void invoke(URL wsdlURL, QName serviceName) throws Exception {
Service service = Service.create(wsdlURL, serviceName);
org.jboss.test.ws.publish.Endpoint port =
service.getPort(org.jboss.test.ws.publish.Endpoint.class);
Modified:
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 2012-01-18
13:14:06 UTC (rev 15495)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl3.xml 2012-01-18
13:16:19 UTC (rev 15496)
@@ -1,4 +1,5 @@
-<?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">
+<?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>
@@ -28,7 +29,7 @@
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EndpointService3">
- <wsdl:port binding="tns:EndpointService3SoapBinding"
name="EndpointPort">
+ <wsdl:port binding="tns:EndpointService3SoapBinding"
name="EndpointPort3">
<soap:address
location="http://localhost:8080/ep-publish-test/pattern3"/>
</wsdl:port>
</wsdl:service>
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/WEB-INF/wsdl/EndpointImpl4.xml 2012-01-18
13:16:19 UTC (rev 15496)
@@ -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="EndpointService4SoapBinding"
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="EndpointService4">
+ <wsdl:port binding="tns:EndpointService4SoapBinding"
name="EndpointPort4">
+ <soap:address
location="http://localhost:8080/ep-publish-test/pattern4"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Modified:
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 2012-01-18
13:14:06 UTC (rev 15495)
+++
shared-testsuite/trunk/testsuite/src/test/resources/publish/WEB-INF/wsdl/EndpointImpl3.xml 2012-01-18
13:16:19 UTC (rev 15496)
@@ -1,4 +1,5 @@
-<?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">
+<?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>
@@ -28,7 +29,7 @@
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EndpointService3">
- <wsdl:port binding="tns:EndpointService3SoapBinding"
name="EndpointPort">
+ <wsdl:port binding="tns:EndpointService3SoapBinding"
name="EndpointPort3">
<soap:address
location="http://localhost:8080/ep-publish-test/pattern3"/>
</wsdl:port>
</wsdl:service>