Author: alessio.soldano(a)jboss.com
Date: 2012-08-27 12:56:45 -0400 (Mon, 27 Aug 2012)
New Revision: 16647
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.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:
[JBWS-3540] Adding testcase
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-08-27
16:55:00 UTC (rev 16646)
+++
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxws.xml 2012-08-27
16:56:45 UTC (rev 16647)
@@ -516,6 +516,8 @@
<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/**/*.class"/>
+ <include name="org/jboss/test/ws/publish/EndpointImpl5.xml"/>
+ <include name="org/jboss/test/ws/publish/TestService.xml"/>
<exclude name="org/jboss/test/ws/publish/*TestCase.class"/>
</classes>
<classes
dir="${tests.output.dir}/test-classes/org/jboss/test/ws/publish"
erroronmissingdir="false">
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.java 2012-08-27
16:56:45 UTC (rev 16647)
@@ -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 EndpointImpl5 implements Provider<SOAPMessage>
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl5.class);
+
+ public SOAPMessage invoke(SOAPMessage request)
+ {
+ log.info("echo (5): " + 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;
+ }
+}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointImpl5.xml 2012-08-27
16:56:45 UTC (rev 16647)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+ <wsdl:definitions name="EndpointService5"
+
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:types>
+ <xsd:schema>
+ <xsd:import
namespace="http://publish.ws.test.jboss.org/"
schemaLocation="TestService.xml" />
+ </xsd:schema>
+ </wsdl:types>
+ <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="EndpointService5SoapBinding"
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="EndpointService5">
+ <wsdl:port binding="tns:EndpointService5SoapBinding"
name="EndpointPort5">
+ <soap:address
location="http://localhost:8080/ep-publish-test/pattern5"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
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-08-27
16:55:00 UTC (rev 16646)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/EndpointPublishServlet.java 2012-08-27
16:56:45 UTC (rev 16647)
@@ -78,6 +78,7 @@
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");
+ map.put("/pattern5",
"org.jboss.test.ws.publish.EndpointImpl5");
ctx = publisher.publish("ep-publish-test",
Thread.currentThread().getContextClassLoader(), map, createMetaData());
@@ -97,6 +98,7 @@
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern2?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService2"));
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern3?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService3"));
invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern4?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService4"));
+ invoke(new URL("http://" + jbossBindAddress +
":8080/ep-publish-test/pattern5?wsdl"), new
QName("http://publish.ws.test.jboss.org/", "EndpointService5"));
res.getWriter().print("1");
}
@@ -134,6 +136,15 @@
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);
+ WebserviceDescriptionMetaData webserviceDescription2 = new
WebserviceDescriptionMetaData(metadata);
+ metadata.addWebserviceDescription(webserviceDescription2);
+
webserviceDescription2.setWsdlFile("org/jboss/test/ws/publish/EndpointImpl5.xml");
//test JBWS-3540
+ PortComponentMetaData portComponent2 = new
PortComponentMetaData(webserviceDescription2);
+ portComponent2.setPortComponentName("PortComponent5"); //unique ID
+
portComponent2.setServiceEndpointInterface("org.jboss.test.ws.publish.EndpointImpl5");
+ portComponent2.setWsdlPort(new
QName("http://publish.ws.test.jboss.org/",
"EndpointPort5"));
+ portComponent2.setWsdlService(new
QName("http://publish.ws.test.jboss.org/", "EndpointService5"));
+ webserviceDescription2.addPortComponent(portComponent2);
return metadata;
}
Added:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/publish/TestService.xml 2012-08-27
16:56:45 UTC (rev 16647)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema version="1.0"
xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+
targetNamespace="http://publish.ws.test.jboss.org/"
+
xmlns:tns="http://publish.ws.test.jboss.org/">
+
+ <element name='foo' type='tns:foo'/>
+</schema>
\ No newline at end of file