Author: thomas.diesler(a)jboss.com
Date: 2006-10-24 11:11:22 -0400 (Tue, 24 Oct 2006)
New Revision: 1298
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Client.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ServletClient.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml
Removed:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java
Modified:
branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java
Log:
Add @WebServiceRef servlet, ejb3 clients
Modified: branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml 2006-10-24 14:16:21 UTC (rev
1297)
+++ branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml 2006-10-24 15:11:22 UTC (rev
1298)
@@ -411,8 +411,11 @@
</war>
<jar
destfile="${build.test.dir}/libs/jaxws-webserviceref-client.jar">
<fileset dir="${build.test.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/webserviceref/*.class"/>
- <exclude
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/EchoResponse.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/Echo.class"/>
</fileset>
<metainf
dir="${build.test.dir}/resources/jaxws/webserviceref/META-INF">
<include name="application-client.xml"/>
@@ -423,6 +426,31 @@
<attribute name="main-class"
value="org.jboss.test.ws.jaxws.webserviceref.ApplicationClient"/>
</manifest>
</jar>
+ <war
destfile="${build.test.dir}/libs/jaxws-webserviceref-servlet-client.war"
webxml="${build.test.dir}/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/ServletClient.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/EchoResponse.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/Echo.class"/>
+ </classes>
+ <webinf
dir="${build.test.dir}/resources/jaxws/webserviceref/META-INF">
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+ <jar
destfile="${build.test.dir}/libs/jaxws-webserviceref-ejb3-client.ejb3">
+ <fileset dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/EJB3Client.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpointService.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/EchoResponse.class"/>
+ <include
name="org/jboss/test/ws/jaxws/webserviceref/Echo.class"/>
+ </fileset>
+ <metainf
dir="${build.test.dir}/resources/jaxws/webserviceref/META-INF">
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
<!-- jaxws-wsaddressing-action -->
<war warfile="${build.test.dir}/libs/jaxws-wsaddressing-action-rpc.war"
webxml="${build.test.dir}/resources/jaxws/wsaddressing/action/WEB-INF/web.xml">
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ApplicationClient.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -23,27 +23,16 @@
import javax.xml.ws.WebServiceRef;
-import org.jboss.logging.Logger;
-
public class ApplicationClient
{
- // Provide logging
- private static Logger log = Logger.getLogger(ApplicationClient.class);
-
@WebServiceRef (name ="TestEndpointService", wsdlLocation
="META-INF/wsdl/TestEndpoint.wsdl")
public static TestEndpointService service;
+ public static String retStr;
+
public static void main(String[] args)
{
- ApplicationClient client = new ApplicationClient();
- String outStr = client.echo("Hello world!");
- log.info(outStr);
- }
-
- public String echo(String inStr)
- {
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
- String outStr = port.echo(inStr);
- return outStr;
+ retStr = port.echo(args[0]);
}
}
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Client.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Client.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Client.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.logging.Logger;
+
+// standard EJB3 annotations
+(a)Remote(EJB3Remote.class)
+@RemoteBinding(jndiBinding = "/ejb3/EJB3Client")
+@Stateless
+public class EJB3Client implements EJB3Remote
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EJB3Client.class);
+
+ @WebServiceRef (name ="TestEndpointService", wsdlLocation
="META-INF/wsdl/TestEndpoint.wsdl")
+ public TestEndpointService service;
+
+ public String echo(String inStr)
+ {
+ log.info("echo: " + inStr);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ String outStr = port.echo(inStr);
+ return outStr;
+ }
+}
Property changes on:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Client.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+public interface EJB3Remote
+{
+ String echo(String input);
+}
Property changes on:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/EJB3Remote.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ServletClient.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ServletClient.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ServletClient.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.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.WebServiceRef;
+
+import org.jboss.logging.Logger;
+
+public class ServletClient extends HttpServlet
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(ServletClient.class);
+
+ @WebServiceRef (name ="TestEndpointService", wsdlLocation
="WEB-INF/wsdl/TestEndpoint.wsdl")
+ public TestEndpointService service;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ String inStr = req.getParameter("echo");
+ log.info("doGet: " + inStr);
+
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ String outStr = port.echo(inStr);
+ res.getWriter().print(outStr);
+ }
+}
Property changes on:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/ServletClient.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java
(from rev 1295,
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java)
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefClientTestCase.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.client.ClientLauncher;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+
+/**
+ * Test the JAXWS annotation: javax.xml.ws.WebServiceref
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 23-Oct-2005
+ */
+public class WebServiceRefClientTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-webserviceref";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(WebServiceRefClientTestCase.class,
"jaxws-webserviceref.war, jaxws-webserviceref-client.jar");
+ }
+
+ public void testWSDLAccess() throws MalformedURLException
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+ assertNotNull(wsdlDefinitions);
+ }
+
+ public void testDynamicProxy() throws Exception
+ {
+ URL wsdlURL = new
File("resources/jaxws/webserviceref/META-INF/wsdl/TestEndpoint.wsdl").toURL();
+ QName qname = new QName("http://org.jboss.ws/wsref",
"TestEndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ String helloWorld = "Hello World!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testApplicationClient() throws Exception
+ {
+ String helloWorld = "Hello World!";
+ ClientLauncher.launch(ApplicationClient.class.getName(),
"jbossws-client", new String[]{helloWorld});
+ assertEquals(helloWorld, ApplicationClient.retStr);
+ }
+}
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+
+/**
+ * Test the JAXWS annotation: javax.xml.ws.WebServiceref
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 23-Oct-2005
+ */
+public class WebServiceRefEJB3TestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-webserviceref";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(WebServiceRefEJB3TestCase.class,
"jaxws-webserviceref.war, jaxws-webserviceref-ejb3-client.ejb3");
+ }
+
+ public void testWSDLAccess() throws MalformedURLException
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+ assertNotNull(wsdlDefinitions);
+ }
+
+ public void testDynamicProxy() throws Exception
+ {
+ URL wsdlURL = new
File("resources/jaxws/webserviceref/META-INF/wsdl/TestEndpoint.wsdl").toURL();
+ QName qname = new QName("http://org.jboss.ws/wsref",
"TestEndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ String helloWorld = "Hello World!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testEJB3Client() throws Exception
+ {
+ InitialContext iniCtx = getInitialContext();
+ EJB3Remote ejb3Remote = (EJB3Remote)iniCtx.lookup("/ejb3/EJB3Client");
+
+ String helloWorld = "Hello World!";
+ Object retObj = ejb3Remote.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+
+ }
+}
Property changes on:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefEJB3TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webserviceref;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+
+/**
+ * Test the JAXWS annotation: javax.xml.ws.WebServiceref
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 23-Oct-2005
+ */
+public class WebServiceRefServletTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-webserviceref";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(WebServiceRefServletTestCase.class,
"jaxws-webserviceref.war, jaxws-webserviceref-servlet-client.war");
+ }
+
+ public void testWSDLAccess() throws MalformedURLException
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+ assertNotNull(wsdlDefinitions);
+ }
+
+ public void testDynamicProxy() throws Exception
+ {
+ URL wsdlURL = new
File("resources/jaxws/webserviceref/META-INF/wsdl/TestEndpoint.wsdl").toURL();
+ QName qname = new QName("http://org.jboss.ws/wsref",
"TestEndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+ String helloWorld = "Hello World!";
+ Object retObj = port.echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testServletClient() throws Exception
+ {
+ 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);
+ }
+}
Property changes on:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefServletTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/webserviceref/WebServiceRefTestCase.java 2006-10-24
15:11:22 UTC (rev 1298)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.webserviceref;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.client.ClientLauncher;
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
-
-/**
- * Test the JAXWS annotation: javax.xml.ws.WebServiceref
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 23-Oct-2005
- */
-public class WebServiceRefTestCase extends JBossWSTest
-{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-webserviceref";
-
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(WebServiceRefTestCase.class,
"jaxws-webserviceref.war, jaxws-webserviceref-client.jar");
- }
-
- public void testWSDLAccess() throws MalformedURLException
- {
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
- }
-
- public void testDynamicProxy() throws Exception
- {
- URL wsdlURL = new
File("resources/jaxws/webserviceref/META-INF/wsdl/TestEndpoint.wsdl").toURL();
- QName qname = new QName("http://org.jboss.ws/wsref",
"TestEndpointService");
- Service service = Service.create(wsdlURL, qname);
- TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
- }
-
- public void testApplicationClient() throws Exception
- {
- ClientLauncher.launch(ApplicationClient.class.getName(),
"jbossws-client", new String[0]);
- }
-}
Added:
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml
===================================================================
---
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml 2006-10-24
14:16:21 UTC (rev 1297)
+++
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml 2006-10-24
15:11:22 UTC (rev 1298)
@@ -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>ServletClient</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.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:
branches/tdiesler/trunk/src/test/resources/jaxws/webserviceref/servlet-client/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF