Author: alessio.soldano(a)jboss.com
Date: 2009-11-20 07:29:00 -0500 (Fri, 20 Nov 2009)
New Revision: 11138
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/WebServiceRefServletTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/jbossws-cxf.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/Endpoint.wsdl
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
[JBWS-2822] Adding testcase: a servlet client using @WebServiceRef to get an endpoint port
having a client side handler configured through jbossws-cxf.xml
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 2009-11-20
07:38:42 UTC (rev 11137)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2009-11-20
12:29:00 UTC (rev 11138)
@@ -82,6 +82,28 @@
<include
name="org/jboss/test/ws/jaxws/cxf/management/HelloWorld.class"/>
</classes>
</war>
+
+ <!-- jaxws-cxf-webserviceref -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-webserviceref.war"
webxml="${tests.output.dir}/test-resources/jaxws/cxf/webserviceref/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.class"/>
+ </classes>
+ </war>
+ <war
destfile="${tests.output.dir}/test-libs/jaxws-cxf-webserviceref-servlet-client.war"
+
webxml="${tests.output.dir}/test-resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/cxf/webserviceref/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/cxf/webserviceref/WEB-INF-client">
+ <include name="jbossws-cxf.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-cxf-wsrm-basic-doc -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-cxf-wsrm-basic-doc.war"
webxml="${tests.output.dir}/test-resources/jaxws/cxf/wsrm/basic-doc/WEB-INF/web.xml">
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+
+@WebService(name = "Endpoint", targetNamespace =
"http://org.jboss.ws/wsref", wsdlLocation =
"http://localhost.localdomain:8080/jaxws-cxf-webserviceref?wsdl")
+@SOAPBinding(style = Style.RPC)
+public interface Endpoint {
+
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/wsref", partName =
"return")
+ public String echo(
+ @WebParam(name = "arg0", partName = "arg0")
+ String arg0);
+
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.logging.Logger;
+
+@WebService(name = "Endpoint", serviceName = "EndpointService",
targetNamespace = "http://org.jboss.ws/wsref")
+@SOAPBinding(style = Style.RPC)
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+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/wsref", wsdlLocation =
"file://bogus-location/jaxws-cxf-webserviceref?wsdl")
+public class EndpointService
+ extends Service
+{
+
+ private final static URL WSDL_LOCATION;
+ private final static QName TESTENDPOINTSERVICE = new
QName("http://org.jboss.ws/wsref", "EndpointService");
+ private final static QName TESTENDPOINTPORT = new
QName("http://org.jboss.ws/wsref", "EndpointPort");
+
+ static {
+ URL url = null;
+ try {
+ url = new
URL("file://bogus-location/jaxws-cxf-webserviceref?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);
+ }
+
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/EndpointService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+import java.util.Iterator;
+
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * A client side handler
+ *
+ */
+public class Handler extends GenericSOAPHandler
+{
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ appendHandlerName(msgContext, "in");
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ appendHandlerName(msgContext, "out");
+ return true;
+ }
+
+ private boolean appendHandlerName(MessageContext msgContext, String direction)
+ {
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPElement soapElement = getFirstChildElement(soapMessage.getSOAPBody());
+ soapElement = getFirstChildElement(soapElement);
+
+ String oldValue = soapElement.getValue();
+ String newValue = oldValue + ":" + direction + ":Handler";
+ soapElement.setValue(newValue);
+
+ return true;
+ }
+ catch (SOAPException ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+
+ private SOAPElement getFirstChildElement(SOAPElement parentNode)
+ {
+ Iterator<?> i = parentNode.getChildElements();
+ while (i.hasNext())
+ {
+ Object currentNode = i.next();
+ if (currentNode instanceof SOAPElement)
+ {
+ return (SOAPElement)currentNode;
+ }
+ }
+
+ return null;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/Handler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ *
+ */
+public class ServletClient extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ // Provide logging
+ private static Logger log = Logger.getLogger(ServletClient.class);
+
+ @WebServiceRef(value = EndpointService.class, type = Endpoint.class, wsdlLocation =
"WEB-INF/wsdl/Endpoint.wsdl")
+ public Endpoint port;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ String inStr = req.getParameter("echo");
+ log.info("doGet: " + inStr);
+
+ String outStr = port.echo(inStr);
+
+ String expectedResult = inStr + ":out:Handler:in:Handler";
+ if (expectedResult.equals(outStr) == false)
+ throw new WebServiceException("Invalid echo return; expected '" +
expectedResult + "' but got '" + outStr + "'");
+
+ res.getWriter().print(inStr);
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/ServletClient.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/WebServiceRefServletTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/WebServiceRefServletTestCase.java 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webserviceref;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test @javax.xml.ws.WebServiceref with a custom CXF jaxws:client
+ * configuration provided through jbossws-cxf.xml file.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ */
+public class WebServiceRefServletTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-cxf-webserviceref";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(WebServiceRefServletTestCase.class,
"jaxws-cxf-webserviceref.war");
+ }
+
+ public void testDynamicProxy() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName qname = new QName("http://org.jboss.ws/wsref",
"EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ String helloWorld = "Hello World!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testServletClient() throws Exception
+ {
+ deploy("jaxws-cxf-webserviceref-servlet-client.war");
+ try
+ {
+ URL url = new URL(TARGET_ENDPOINT_ADDRESS +
"-servlet-client?echo=HelloWorld");
+ BufferedReader br = new BufferedReader(new
InputStreamReader(url.openStream()));
+ String retStr = br.readLine();
+ assertEquals("HelloWorld", retStr);
+ }
+ finally
+ {
+ undeploy("jaxws-cxf-webserviceref-servlet-client.war");
+ }
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/webserviceref/WebServiceRefServletTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/web.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/web.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/web.xml 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.webserviceref.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/Endpoint.wsdl
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/Endpoint.wsdl
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/Endpoint.wsdl 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,36 @@
+<definitions name='EndpointService'
targetNamespace='http://org.jboss.ws/wsref'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.ws/wsref'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <message name='Endpoint_echo'>
+ <part name='arg0' type='xsd:string'/>
+ </message>
+ <message name='Endpoint_echoResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+
+ <portType name='Endpoint'>
+ <operation name='echo' parameterOrder='arg0'>
+ <input message='tns:Endpoint_echo'/>
+ <output message='tns:Endpoint_echoResponse'/>
+ </operation>
+ </portType>
+
+ <binding name='EndpointBinding' type='tns:Endpoint'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/wsref'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/wsref'
use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name='EndpointService'>
+ <port binding='tns:EndpointBinding' name='EndpointPort'>
+ <soap:address
location='http://@jboss.bind.address@:8080/jaxws-cxf-webserviceref'/>
+ </port>
+ </service>
+
+</definitions>
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF/wsdl/Endpoint.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/jbossws-cxf.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/jbossws-cxf.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/jbossws-cxf.xml 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
xmlns="http://www.springframework.org/schema/beans"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:http="http://cxf.apache.org/transports/http/configuration"
+
xmlns:jaxws="http://cxf.apache.org/jaxws"
+
xmlns:cxf="http://cxf.apache.org/core"
+
xmlns:p="http://cxf.apache.org/policy"
+
xmlns:sec="http://cxf.apache.org/configuration/security"
+ xsi:schemaLocation="
+
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
+
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+
http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd"
+>
+ <bean id="jaxwsHandler"
class="org.jboss.test.ws.jaxws.cxf.webserviceref.Handler" />
+
+ <jaxws:client name="{http://org.jboss.ws/wsref}EndpointPort"
createdFromAPI="true"
+ serviceClass="org.jboss.test.ws.jaxws.cxf.webserviceref.Endpoint">
+
+ <jaxws:handlers>
+ <ref bean="jaxwsHandler" />
+ </jaxws:handlers>
+ </jaxws:client>
+
+</beans>
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/jbossws-cxf.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml 2009-11-20
12:29:00 UTC (rev 11138)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>ServletClient</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.webserviceref.ServletClient</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ServletClient</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/webserviceref/WEB-INF-client/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF