Author: heiko.braun(a)jboss.com
Date: 2007-05-24 08:26:08 -0400 (Thu, 24 May 2007)
New Revision: 3231
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPTestCase.java
branches/jbossws-2.0/jbossws-tests/src/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml
Log:
Added testcase for xop with wrapped endpoints using parameter annotations
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
(rev 0)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java 2007-05-24
12:26:08 UTC (rev 3231)
@@ -0,0 +1,16 @@
+package org.jboss.test.ws.jaxws.samples.xop.doclit;
+
+import javax.activation.DataHandler;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.ws.BindingType;
+
+@WebService
+@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+public interface WrappedEndpoint
+{
+ @WebMethod
+ @XmlMimeType("text/plain")
+ DataHandler parameterAnnotation(@XmlMimeType("text/plain") DataHandler
data);
+}
Property changes on:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
(rev 0)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java 2007-05-24
12:26:08 UTC (rev 3231)
@@ -0,0 +1,54 @@
+/*
+ * 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.samples.xop.doclit;
+
+import org.jboss.ws.WSException;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.ws.BindingType;
+import javax.activation.DataHandler;
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ */
+@WebService(name = "WrappedEndpoint", serviceName = "WrappedService",
endpointInterface =
"org.jboss.test.ws.jaxws.samples.xop.doclit.WrappedEndpoint")
+public class WrappedEndpointImpl implements WrappedEndpoint
+{
+
+ @WebMethod
+ @XmlMimeType("text/plain")
+ public DataHandler parameterAnnotation(@XmlMimeType("text/plain")DataHandler
data)
+ {
+ try
+ {
+ System.out.println("Got " + data.getContent());
+ return new DataHandler("Server data", "text/plain");
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
+}
Property changes on:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/WrappedEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2007-05-24
12:25:19 UTC (rev 3230)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.java 2007-05-24
12:26:08 UTC (rev 3231)
@@ -51,7 +51,7 @@
*/
public class XOPHandlerTestCase extends XOPBase
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-xop-doclit/MTOMService";
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-xop-doclit/bare";
public static Test suite()
{
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPTestCase.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPTestCase.java 2007-05-24
12:25:19 UTC (rev 3230)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPTestCase.java 2007-05-24
12:26:08 UTC (rev 3231)
@@ -47,7 +47,7 @@
public class XOPTestCase extends XOPBase
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-xop-doclit/MTOMService";
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-xop-doclit/bare";
public static Test suite()
{
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
(rev 0)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java 2007-05-24
12:26:08 UTC (rev 3231)
@@ -0,0 +1,75 @@
+/*
+ * 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.samples.xop.doclit;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.JBossWSTest;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.activation.DataHandler;
+import java.net.URL;
+
+/**
+ * Test @XmlMimeType annocations on wrapped services.
+ * The annotations should be copied to the generated wrapper beans.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ */
+public class XOPWrappedTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-samples-xop-doclit/wrapped";
+
+ private WrappedEndpoint port;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(XOPWrappedTestCase.class,
"jaxws-samples-xop-doclit.war");
+ }
+
+ protected void setUp() throws Exception
+ {
+
+ QName serviceName = new
QName("http://doclit.xop.samples.jaxws.ws.test.jboss.org/",
"WrappedService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = service.getPort(WrappedEndpoint.class);
+
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
+ binding.setMTOMEnabled(true);
+
+ }
+
+ public void testParameterAnnotation() throws Exception
+ {
+ DataHandler request = new DataHandler("Client data",
"text/plain");
+ DataHandler response = port.parameterAnnotation(request);
+
+ assertNotNull(response);
+ assertEquals(response.getContent(), "Server data");
+ }
+
+}
Property changes on:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/xop/doclit/XOPWrappedTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-2.0/jbossws-tests/src/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml 2007-05-24
12:25:19 UTC (rev 3230)
+++
branches/jbossws-2.0/jbossws-tests/src/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml 2007-05-24
12:26:08 UTC (rev 3231)
@@ -1,17 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app
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"
- version="2.4">
+
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"
+ version="2.4">
- <servlet>
- <servlet-name>MTOMService</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.samples.xop.doclit.MTOMEndpointBean</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>MTOMService</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
+ <servlet>
+ <servlet-name>MTOMService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.samples.xop.doclit.MTOMEndpointBean</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>WrappedService</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.samples.xop.doclit.WrappedEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>MTOMService</servlet-name>
+ <url-pattern>/bare</url-pattern>
+ </servlet-mapping>
+
+
+ <servlet-mapping>
+ <servlet-name>WrappedService</servlet-name>
+ <url-pattern>/wrapped</url-pattern>
+ </servlet-mapping>
</web-app>