Author: alessio.soldano(a)jboss.com
Date: 2010-10-06 06:28:19 -0400 (Wed, 06 Oct 2010)
New Revision: 13061
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientRemoteInterface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/Endpoint.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointService.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/wsdl/Endpoint.wsdl
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
[JBWS-3144] Adding initial testcase
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-10-06
09:01:49 UTC (rev 13060)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-10-06
10:28:19 UTC (rev 13061)
@@ -22,6 +22,28 @@
<mkdir dir="${tests.output.dir}/test-libs"/>
+ <!-- jaxws-cxf-bus -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-bus.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/bus/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.class"/>
+ </fileset>
+ </jar>
+ <!-- jaxws-cxf-bus-ejb3-client -->
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-cxf-bus-ejb3-client.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/cxf/bus/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/EndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientRemoteInterface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/bus/BusTestException.class"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/test-resources/jaxws/cxf/bus/META-INF">
+ <include name="**/*" />
+ </metainf>
+ </jar>
+
<!-- jaxws-cxf-endorse -->
<war warfile="${tests.output.dir}/test-libs/jaxws-cxf-endorse.war"
webxml="${tests.output.dir}/test-resources/jaxws/cxf/endorse/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/AbstractClient.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2010
+ *
+ */
+public abstract class AbstractClient
+{
+ public abstract void testBusCreation() throws BusTestException;
+
+ public abstract void testSOAPConnection(String host) throws BusTestException,
Exception;
+
+ public abstract void testWebServiceRef() throws BusTestException;
+
+ public abstract void testWebServiceClient(String host) throws BusTestException,
Exception;
+
+ protected String getEndpointURL(String host)
+ {
+ return "http://" + host +
":8080/jaxws-cxf-bus/EndpointService/Endpoint";
+ }
+
+ protected void performSOAPCall(String endpointAddress) throws SOAPException,
MalformedURLException
+ {
+ SOAPFactory soapFac = SOAPFactory.newInstance();
+ MessageFactory msgFac = MessageFactory.newInstance();
+ SOAPConnectionFactory conFac = SOAPConnectionFactory.newInstance();
+ SOAPMessage msg = msgFac.createMessage();
+ SOAPConnection con = conFac.createConnection();
+ QName echo = new QName("http://org.jboss.ws.jaxws.cxf/bus",
"echo");
+ SOAPElement element = soapFac.createElement(echo);
+ element.addTextNode("John");
+ msg.getSOAPBody().addChildElement(element);
+ SOAPMessage response = con.call(msg, new URL(endpointAddress));
+ assert (response != null);
+ }
+
+ protected void performInvocation(Endpoint endpoint)
+ {
+ String result = endpoint.echo("Alessio");
+ assert ("Alessio".equals(result));
+ }
+
+ protected void performInvocation(String endpointUrl) throws MalformedURLException
+ {
+ URL wsdlURL = new URL(endpointUrl + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/bus",
"EndpointService");
+ Service service = Service.create(wsdlURL, serviceName);
+ QName portQName = new QName("http://org.jboss.ws/bus",
"EndpointPort");
+ Endpoint endpoint = (Endpoint) service.getPort(portQName, Endpoint.class);
+ performInvocation(endpoint);
+ }
+
+ protected void checkDefaultBus(Bus expectedDefaultBus) throws BusTestException
+ {
+ Bus bus = BusFactory.getDefaultBus(false);
+ if (bus != expectedDefaultBus)
+ {
+ throw new BusTestException("Default bus set to " + bus + "
instead of expected " + expectedDefaultBus);
+ }
+ }
+
+ protected void checkThreadBus(Bus expectedThreadBus) throws BusTestException
+ {
+ Bus bus = BusFactory.getThreadDefaultBus(false);
+ if (bus != expectedThreadBus)
+ {
+ throw new BusTestException("Thread " + Thread.currentThread() + "
associated with bus " + bus
+ + " instead of expected bus " + expectedThreadBus);
+ }
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/BusTestException.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+public class BusTestException extends Exception
+{
+ public BusTestException(String message)
+ {
+ super(message);
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3Client.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.xml.ws.WebServiceRef;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+
+/**
+ * This class verifies the default bus is not changed by
+ * basic client use (creation of bus through BusFactory.newInstance().createBus(),
+ * SAAJ invocation, endpoint invocation, endpoint invocation using webserviceref).
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2010
+ *
+ */
+@Stateless
+(a)Remote(EJB3ClientRemoteInterface.class)
+public class EJB3Client extends AbstractClient
+{
+ @WebServiceRef(value = EndpointService.class, type = Endpoint.class, wsdlLocation =
"META-INF/wsdl/Endpoint.wsdl")
+ public Endpoint port;
+
+ public void testBusCreation() throws BusTestException
+ {
+ Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+ Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+ BusFactory factory = BusFactory.newInstance();
+ Bus bus = factory.createBus();
+ assert (bus != null);
+ checkThreadBus(bus);
+ checkDefaultBus(initialDefaultBus);
+ BusFactory.setThreadDefaultBus(initialThreadBus);
+ checkThreadBus(initialThreadBus);
+ checkDefaultBus(initialDefaultBus);
+ }
+
+ public void testSOAPConnection(String host) throws BusTestException, Exception
+ {
+ Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+ Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+ //first call... the thread bus is reused if not null, otherwise a new one is
created
+ performSOAPCall(getEndpointURL(host));
+ checkDefaultBus(initialDefaultBus);
+ if (initialThreadBus != null)
+ {
+ checkThreadBus(initialThreadBus);
+ }
+ else
+ {
+ initialThreadBus = BusFactory.getThreadDefaultBus(false);
+ }
+ //second call...
+ performSOAPCall(getEndpointURL(host));
+ checkThreadBus(initialThreadBus);
+ checkDefaultBus(initialDefaultBus);
+ }
+
+ public void testWebServiceRef() throws BusTestException
+ {
+ Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+ Bus initialThreadBus = BusFactory.getThreadDefaultBus(false);
+ performInvocation(port);
+ checkThreadBus(initialThreadBus); //this can probably be relaxed as below
+ checkDefaultBus(initialDefaultBus);
+ }
+
+ public void testWebServiceClient(String host) throws BusTestException, Exception
+ {
+ Bus initialDefaultBus = BusFactory.getDefaultBus(false);
+ performInvocation(getEndpointURL(host));
+ checkDefaultBus(initialDefaultBus);
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientBusTestCase.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * A test case that verifies Bus references do not leak into EJB3 clients
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 05-Oct-2010
+ *
+ */
+public class EJB3ClientBusTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(EJB3ClientBusTestCase.class,
"jaxws-cxf-bus.jar");
+ }
+
+ public void testSingleDeploy() throws Exception
+ {
+ deploy("jaxws-cxf-bus-ejb3-client.jar");
+ try
+ {
+ String host = getServerHost();
+ InitialContext iniCtx = getInitialContext();
+ EJB3ClientRemoteInterface ejb3Remote =
(EJB3ClientRemoteInterface)iniCtx.lookup("/EJB3Client/remote");
+ ejb3Remote.testBusCreation();
+ ejb3Remote.testSOAPConnection(host);
+ ejb3Remote.testWebServiceClient(host);
+ ejb3Remote.testWebServiceRef();
+ }
+ finally
+ {
+ undeploy("jaxws-cxf-bus-ejb3-client.jar");
+ }
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientRemoteInterface.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientRemoteInterface.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EJB3ClientRemoteInterface.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+public interface EJB3ClientRemoteInterface
+{
+ public void testBusCreation() throws BusTestException;
+
+ public void testSOAPConnection(String host) throws BusTestException, Exception;
+
+ public void testWebServiceRef() throws BusTestException;
+
+ public void testWebServiceClient(String host) throws BusTestException, Exception;
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/Endpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/Endpoint.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/Endpoint.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+
+@WebService(name = "Endpoint", targetNamespace =
"http://org.jboss.ws/bus", wsdlLocation =
"http://localhost.localdomain:8080/jaxws-cxf-bus?wsdl")
+public interface Endpoint {
+
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ public String echo(String arg0);
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointImpl.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import org.jboss.logging.Logger;
+
+@WebService(name = "Endpoint", serviceName = "EndpointService",
targetNamespace = "http://org.jboss.ws/bus")
+@Stateless
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointService.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointService.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/bus/EndpointService.java 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws.cxf.bus;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+@WebServiceClient(name = "EndpointService", targetNamespace =
"http://org.jboss.ws/bus", wsdlLocation =
"file://bogus-location/jaxws-cxf-busf?wsdl")
+public class EndpointService
+ extends Service
+{
+
+ private final static URL WSDL_LOCATION;
+ private final static QName TESTENDPOINTSERVICE = new
QName("http://org.jboss.ws/bus", "EndpointService");
+ private final static QName TESTENDPOINTPORT = new
QName("http://org.jboss.ws/bus", "EndpointPort");
+
+ static {
+ URL url = null;
+ try {
+ url = new URL("file://bogus-location/jaxws-cxf-bus?wsdl");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ WSDL_LOCATION = url;
+ }
+
+ public EndpointService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public EndpointService() {
+ super(WSDL_LOCATION, TESTENDPOINTSERVICE);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort() {
+ return (Endpoint)super.getPort(TESTENDPOINTPORT, Endpoint.class);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort(WebServiceFeature... features) {
+ return (Endpoint)super.getPort(TESTENDPOINTPORT, Endpoint.class, features);
+ }
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/wsdl/Endpoint.wsdl
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/wsdl/Endpoint.wsdl
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/bus/META-INF/wsdl/Endpoint.wsdl 2010-10-06
10:28:19 UTC (rev 13061)
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<wsdl:definitions name="EndpointService"
targetNamespace="http://org.jboss.ws/bus"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://org.jboss.ws/bus"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+<xs:schema elementFormDefault="unqualified"
targetNamespace="http://org.jboss.ws/bus" version="1.0"
xmlns:tns="http://org.jboss.ws/bus"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:element name="echo" type="tns:echo" />
+<xs:element name="echoResponse" type="tns:echoResponse" />
+<xs:complexType name="echo">
+<xs:sequence>
+<xs:element minOccurs="0" name="arg0" type="xs:string"
/>
+</xs:sequence>
+</xs:complexType>
+<xs:complexType name="echoResponse">
+<xs:sequence>
+<xs:element minOccurs="0" name="return" type="xs:string"
/>
+</xs:sequence>
+</xs:complexType>
+</xs:schema>
+
+ </wsdl:types>
+ <wsdl:message name="echoResponse">
+ <wsdl:part element="tns:echoResponse" name="parameters">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="echo">
+ <wsdl:part element="tns:echo" name="parameters">
+ </wsdl:part>
+ </wsdl:message>
+
+ <wsdl:portType name="Endpoint">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echo" name="echo">
+ </wsdl:input>
+ <wsdl:output message="tns:echoResponse"
name="echoResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="EndpointServiceSoapBinding"
type="tns:Endpoint">
+
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="echo">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="echo">
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="echoResponse">
+ <soap:body use="literal" />
+ </wsdl:output>
+
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EndpointService">
+ <wsdl:port binding="tns:EndpointServiceSoapBinding"
name="EndpointPort">
+ <soap:address
location="http://localhost:8080/jaxws-cxf-bus/EndpointService/Endpoint" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file