Author: heiko.braun(a)jboss.com
Date: 2007-05-23 08:02:26 -0400 (Wed, 23 May 2007)
New Revision: 3212
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
Log:
Added rpc/lit example
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java
(rev 0)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.java 2007-05-23
12:02:26 UTC (rev 3212)
@@ -0,0 +1,19 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlAttachmentRef;
+import java.rmi.RemoteException;
+
+@Remote
+@WebService
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface RpcLitEndpoint
+{
+ @WebMethod
+ @XmlAttachmentRef
+ DataHandler echo(@XmlAttachmentRef DataHandler data) throws RemoteException;
+}
Property changes on:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpoint.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/swaref/RpcLitEndpointImpl.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java
(rev 0)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/RpcLitEndpointImpl.java 2007-05-23
12:02:26 UTC (rev 3212)
@@ -0,0 +1,33 @@
+package org.jboss.test.ws.jaxws.samples.swaref;
+
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.WSException;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.activation.DataHandler;
+import java.rmi.RemoteException;
+import java.io.IOException;
+
+@Stateless
+@WebService(endpointInterface =
"org.jboss.test.ws.jaxws.samples.swaref.RpcLitEndpoint")
+@WebContext(contextRoot = "jaxws-swaref")
+public class RpcLitEndpointImpl implements RpcLitEndpoint
+{
+
+ @WebMethod
+ public DataHandler echo(DataHandler data) throws RemoteException
+ {
+ 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/swaref/RpcLitEndpointImpl.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/swaref/SWARefTestCase.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-23
11:52:35 UTC (rev 3211)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java 2007-05-23
12:02:26 UTC (rev 3212)
@@ -3,7 +3,6 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.StubExt;
import javax.xml.ws.Service;
import javax.xml.ws.BindingProvider;
@@ -18,17 +17,19 @@
{
private String bareEndpointURL = "http://" + getServerHost() +
":8080/jaxws-swaref/BareEndpointImpl";
private String wrappedEndpointURL = "http://" + getServerHost() +
":8080/jaxws-swaref/WrappedEndpointImpl";
+ private String rpclitEndpointURL = "http://" + getServerHost() +
":8080/jaxws-swaref/RpcLitEndpointImpl";
private QName bareServiceQName = new
QName("http://swaref.samples.jaxws.ws.test.jboss.org/",
"BareEndpointImplService");
- private QName wrappedServiceQName = new
QName("http://swaref.samples.jaxws.ws.test.jboss.org/",
"WrappedEndpointImplService");
+ private QName wrappedServiceQName = new
QName("http://swaref.samples.jaxws.ws.test.jboss.org/",
"WrappedEndpointImplService");
+ private QName rpcLitServiceQName = new
QName("http://swaref.samples.jaxws.ws.test.jboss.org/",
"RpcLitEndpointImplService");
private static DataHandler data = new DataHandler("Client data",
"text/plain");
-
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(SWARefTestCase.class,
"jaxws-samples-swaref.jar");
}
-
+
public void testSubmitAttachment() throws Exception
{
Service service = Service.create(new URL(bareEndpointURL +"?wsdl"),
bareServiceQName);
@@ -48,16 +49,22 @@
Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"),
wrappedServiceQName);
WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
- // tweak endpoint URL
- BindingProvider provider = (BindingProvider)port;
- provider.getRequestContext().put(
- BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
- wrappedEndpointURL
- );
-
- DocumentPayload response = port.myTest(new DocumentPayload(data), "Hello
world");
+ DocumentPayload response = port.echo(new DocumentPayload(data), "Wrapped
test");
assertTrue(response.getData().getContent().equals("Server data"));
}
+ public void testRpcLitEndpoint() throws Exception
+ {
+ System.out.println("FIXME [JBWS-1460]: @XmlMimeType and @XmlAttachmentRef on
SEI parameter declarations");
+ /*Service service = Service.create(new URL(rpclitEndpointURL+"?wsdl"),
rpcLitServiceQName);
+ RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
+
+ DataHandler response = port.echo(data);
+ assertNotNull("Response was null", response);
+ assertTrue(response.getContent().equals("Server data"));
+ */
+ }
+
+
}
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2007-05-23
11:52:35 UTC (rev 3211)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpoint.java 2007-05-23
12:02:26 UTC (rev 3212)
@@ -1,7 +1,5 @@
package org.jboss.test.ws.jaxws.samples.swaref;
-import org.jboss.ws.annotation.WebContext;
-
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.ejb.Remote;
@@ -12,8 +10,8 @@
public interface WrappedEndpoint
{
/* (non-Javadoc)
- * @see org.jboss.ws.test.TestService#myTest(javax.activation.DataHandler)
+ * @see org.jboss.ws.test.TestService#echo(javax.activation.DataHandler)
*/
@WebMethod
- DocumentPayload myTest(DocumentPayload dhw, String test) throws RemoteException;
+ DocumentPayload echo(DocumentPayload dhw, String test) throws RemoteException;
}
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java
===================================================================
---
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-23
11:52:35 UTC (rev 3211)
+++
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/swaref/WrappedEndpointImpl.java 2007-05-23
12:02:26 UTC (rev 3212)
@@ -17,10 +17,10 @@
public class WrappedEndpointImpl implements WrappedEndpoint
{
/* (non-Javadoc)
- * @see org.jboss.ws.test.TestService#myTest(javax.activation.DataHandler)
+ * @see org.jboss.ws.test.TestService#echo(javax.activation.DataHandler)
*/
@WebMethod
- public DocumentPayload myTest(DocumentPayload dhw, String test) throws
RemoteException
+ public DocumentPayload echo(DocumentPayload dhw, String test) throws RemoteException
{
DataHandler dh;