Author: richard.opalka(a)jboss.com
Date: 2007-10-29 17:10:36 -0400 (Mon, 29 Oct 2007)
New Revision: 4928
Added:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
Log:
synchronizing local working copy with SVN
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -54,7 +54,6 @@
import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
-import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -23,11 +23,8 @@
// $Id$
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -76,12 +73,10 @@
import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.extensions.wsrm.RMConstant;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.metadata.umdm.TypesMetaData;
-import org.jboss.ws.metadata.wsrm.ReliableMessagingMetaData;
import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.common.JavaUtils;
import org.jboss.xb.binding.NamespaceRegistry;
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -112,6 +112,11 @@
{
this.wsrmSequence = wsrmSequence;
}
+
+ public final RMSequence getWSRMSequence()
+ {
+ return this.wsrmSequence;
+ }
public ClientImpl(EndpointMetaData epMetaData, HandlerResolver handlerResolver)
{
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/core/jaxws/client/ClientProxy.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -28,7 +28,6 @@
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -49,9 +48,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.StubExt;
-import org.jboss.ws.extensions.wsrm.RMConstant;
import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
-import org.jboss.ws.extensions.wsrm.spi.Provider;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.common.JavaUtils;
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMClientHandler.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -47,6 +47,7 @@
import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
import org.jboss.ws.extensions.wsrm.spi.protocol.Sequence;
import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
+import org.jboss.ws.extensions.wsrm.spi.protocol.TerminateSequence;
/**
* TODO: add comment
@@ -108,10 +109,6 @@
RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
Sequence sequence = rmProvider.getMessageFactory().newSequence();
sequence.setIdentifier(sequenceImpl.getId());
- if (sequenceImpl.isLastMessage())
- {
- sequence.setLastMessage();
- }
sequence.setMessageNumber(sequenceImpl.newMessageNumber());
sequence.serializeTo(soapMessage);
@@ -132,6 +129,21 @@
return true;
}
+
+ if (RMConstant.TERMINATE_SEQUENCE.equals(operation))
+ {
+ RMSequenceImpl sequenceImpl =
(RMSequenceImpl)rmRequestContext.get(RMConstant.SEQUENCE_REFERENCE);
+ TerminateSequence terminateSequence =
rmProvider.getMessageFactory().newTerminateSequence();
+ terminateSequence.setIdentifier(sequenceImpl.getId());
+ terminateSequence.setLastMsgNumber(sequenceImpl.getLastMessageNumber());
+ terminateSequence.serializeTo(soapMessage);
+
+ List<Serializable> data = new LinkedList<Serializable>();
+ data.add(terminateSequence);
+ rmRequestContext.put(RMConstant.DATA, data);
+
+ return true;
+ }
}
else
{
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMConstant.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -24,10 +24,11 @@
public static final String REQUEST_CONTEXT = PREFIX + ".requestContext";
public static final String RESPONSE_CONTEXT = PREFIX + ".responseContext";
public static final String SEQUENCE_REFERENCE = PREFIX +
".sequenceReference";
- // TODO: separate this to enum - START
+ // TODO: use RMProvider.getConstants().getXXX() instead - START
public static final String CREATE_SEQUENCE = PREFIX + ".createSequence";
public static final String CREATE_SEQUENCE_RESPONSE = PREFIX +
".createSequenceResponse";
public static final String SEQUENCE = PREFIX + ".sequence";
+ public static final String TERMINATE_SEQUENCE = PREFIX +
".terminateSequence";
// TODO: separate this to enum - END
public static final String DATA = PREFIX + ".data";
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/RMSequenceImpl.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -21,12 +21,22 @@
*/
package org.jboss.ws.extensions.wsrm;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import javax.xml.namespace.QName;
+
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.extensions.wsrm.client_api.RMException;
import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
+import org.jboss.ws.extensions.wsrm.spi.Provider;
+import org.jboss.ws.extensions.wsrm.spi.protocol.CreateSequenceResponse;
+import org.jboss.ws.extensions.wsrm.spi.protocol.Serializable;
/**
* Reliable messaging sequence implementation
@@ -40,11 +50,10 @@
private final String id;
private final ClientImpl client;
// object states variables
- private boolean closed = false;
private boolean terminated = false;
private boolean discarded = false;
- private boolean lastMessage = false;
- private AtomicLong messageNo = new AtomicLong();
+ private AtomicLong messageNumber = new AtomicLong();
+ private final Lock objectLock = new ReentrantLock();
public RMSequenceImpl(ClientImpl client, String id)
{
@@ -53,38 +62,89 @@
this.id = id;
}
- public final void close() throws RMException
- {
- this.closed = true;
- }
-
public final long newMessageNumber()
{
- return this.messageNo.incrementAndGet();
+ this.objectLock.lock();
+ try
+ {
+ return this.messageNumber.incrementAndGet();
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
}
public final long getLastMessageNumber()
{
- return this.messageNo.get();
+ this.objectLock.lock();
+ try
+ {
+ return this.messageNumber.get();
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
}
public final void discard() throws RMException
{
- this.client.getWSRMLock().lock();
+ this.objectLock.lock();
try
{
- this.client.setWSRMSequence(null);
- this.discarded = true;
+ this.client.getWSRMLock().lock();
+ try
+ {
+ this.client.setWSRMSequence(null);
+ this.discarded = true;
+ }
+ finally
+ {
+ this.client.getWSRMLock().unlock();
+ }
}
finally
{
- this.client.getWSRMLock().unlock();
+ this.objectLock.unlock();
}
}
public final void terminate() throws RMException
{
- this.terminated = true;
+ this.objectLock.lock();
+ try
+ {
+ if (this.terminated)
+ return;
+
+ this.terminated = true;
+
+ client.getWSRMLock().lock();
+ try
+ {
+ try
+ {
+ QName terminateSequenceQN =
Provider.get().getConstants().getTerminateSequenceQName();
+ Map<String, Object> rmRequestContext = new HashMap<String,
Object>();
+ rmRequestContext.put(RMConstant.OPERATION_TYPE,
RMConstant.TERMINATE_SEQUENCE);
+ rmRequestContext.put(RMConstant.SEQUENCE_REFERENCE,
client.getWSRMSequence());
+
this.client.getBindingProvider().getRequestContext().put(RMConstant.REQUEST_CONTEXT,
rmRequestContext);
+ this.client.invoke(terminateSequenceQN, new Object[] {},
this.client.getBindingProvider().getResponseContext());
+ }
+ catch (Exception e) {
+ throw new RMException("Unable to create WSRM sequence", e);
+ }
+ }
+ finally
+ {
+ this.client.getWSRMLock().unlock();
+ }
+ }
+ finally
+ {
+ this.objectLock.unlock();
+ }
}
public final boolean isCompleted()
@@ -102,28 +162,13 @@
return id;
}
- public final void setLastMessage()
- {
- this.lastMessage = true;
- }
-
- public final boolean isLastMessage()
- {
- return this.lastMessage;
- }
-
public final boolean isTerminated()
{
return this.terminated;
}
- public final boolean isClosed()
+ public final boolean isDiscarded()
{
- return this.closed;
- }
-
- public boolean isDiscarded()
- {
return this.discarded;
}
}
Modified:
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/main/java/org/jboss/ws/extensions/wsrm/client_api/RMSequence.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -25,16 +25,11 @@
public interface RMSequence
{
- void close() throws RMException;
void discard() throws RMException;
+ boolean isDiscarded() throws RMException;
void terminate() throws RMException;
+ boolean isTerminated() throws RMException;
String getId() throws RMException;
- void setLastMessage() throws RMException;
boolean isCompleted() throws RMException;
boolean isCompleted(int timeAmount, TimeUnit timeUnit) throws RMException;
- boolean isClosed() throws RMException;
- boolean isLastMessage() throws RMException;
- long getLastMessageNumber() throws RMException;
- boolean isDiscarded() throws RMException;
- boolean isTerminated() throws RMException;
}
Added:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -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.wsrm;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.ws.extensions.addressing.AddressingClientUtil;
+
+/**
+ * Test helper
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Oct 29, 2007
+ */
+public final class Helper
+{
+
+ private Helper()
+ {
+ // no instances
+ }
+
+ public static void setAddrProps(Object proxy, String wsaAction, String serviceURL)
+ {
+ BindingProvider bp = (BindingProvider)proxy;
+ AddressingProperties props = AddressingClientUtil.createAnonymousProps(wsaAction,
serviceURL);
+ bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
+ }
+
+}
Property changes on:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/Helper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceIface.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -1,6 +1,8 @@
package org.jboss.test.ws.jaxws.wsrm;
+import javax.jws.Oneway;
import javax.jws.WebService;
+import javax.xml.ws.addressing.Action;
import org.jboss.ws.annotation.EndpointConfig;
@@ -8,9 +10,15 @@
@EndpointConfig(configName = "Standard WSRM Client", configFile =
"META-INF/wsrm-jaxws-client-config.xml")
public interface OneWayServiceIface
{
+ @Oneway
+ @Action(input="http://wsrm.example/oneway/method1")
void method1();
+ @Action(input="http://wsrm.example/oneway/method2")
+ @Oneway
void method2(String s);
+ @Action(input="http://wsrm.example/oneway/method3")
+ @Oneway
void method3(String[] sa);
}
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/OneWayServiceImpl.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -1,6 +1,9 @@
package org.jboss.test.ws.jaxws.wsrm;
+import javax.jws.Oneway;
import javax.jws.WebService;
+import javax.xml.ws.addressing.Action;
+
import org.jboss.logging.Logger;
import org.jboss.ws.extensions.policy.PolicyScopeLevel;
import org.jboss.ws.extensions.policy.annotation.Policy;
@@ -26,16 +29,22 @@
{
private Logger log = Logger.getLogger(OneWayServiceImpl.class);
+ @Action(input="http://wsrm.example/oneway/method1")
+ @Oneway
public void method1()
{
log.info("method1()");
}
+ @Action(input="http://wsrm.example/oneway/method2")
+ @Oneway
public void method2(String s)
{
log.info("method2(" + s + ")");
}
+ @Action(input="http://wsrm.example/oneway/method3")
+ @Oneway
public void method3(String[] sa)
{
log.info("method3(" + Arrays.asList(sa) + ")");
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceIface.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -9,6 +9,7 @@
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.addressing.Action;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Response;
@@ -20,12 +21,15 @@
public interface ReqResServiceIface
{
@WebMethod(operationName = "echo")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
public Response<String> echoAsync(@WebParam(name = "String_1") String
string1);
@WebMethod(operationName = "echo")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
public Future<?> echoAsync(@WebParam(name = "String_1") String
string1, @WebParam(name = "asyncHandler") AsyncHandler<String>
asyncHandler);
@WebMethod
@WebResult(name = "result")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
public String echo(@WebParam(name = "String_1") String string1);
}
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/ReqResServiceImpl.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -6,6 +6,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.ws.addressing.Action;
import org.jboss.logging.Logger;
import org.jboss.ws.extensions.policy.PolicyScopeLevel;
@@ -36,6 +37,7 @@
@WebMethod
@WebResult(name = "result")
+ @Action(input="http://wsrm.example/reqres/echo/input",
output="http://wsrm.example/reqres/echo/output")
public String echo(@WebParam(name = "String_1") String msg)
{
log.info("echo: " + msg);
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -75,10 +75,18 @@
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
+ String pathInfo = req.getPathInfo();
+ System.out.println(pathInfo);
resp.setContentType("text/xml");
PrintWriter writer = resp.getWriter();
- String wsdlFile = getResource("WEB-INF/resources/ReqResService.wsdl");
- writer.print(wsdlFile);
+ if (pathInfo.equals("/OneWayService"))
+ {
+ writer.print(getResource("WEB-INF/resources/OneWayService.wsdl"));
+ }
+ else
+ {
+ writer.print(getResource("WEB-INF/resources/ReqResService.wsdl"));
+ }
writer.flush();
writer.close();
}
@@ -93,6 +101,8 @@
String response = getResource("WEB-INF/resources/echoResponse.xml");
if (properties.get("addressing.action").equals(CREATE_SEQUENCE_ACTION))
response =
getResource("WEB-INF/resources/createSequenceResponse.xml");
+ if
(properties.get("addressing.action").equals(TERMINATE_SEQUENCE_ACTION))
+ response =
getResource("WEB-INF/resources/terminateSequenceResponse.xml");
response = modifyResponse(response, properties);
writer.print(response);
writer.flush();
@@ -164,6 +174,13 @@
.getElementsByTagNameNS(WSRM_NS,
"MessageNumber").item(0).getTextContent().trim();
retVal.put("messaging.messagenumber", messageNumber);
}
+ NodeList terminateSequence = document.getElementsByTagNameNS(WSRM_NS,
"TerminateSequence");
+ if (terminateSequence != null && terminateSequence.getLength() != 0)
+ {
+ String sequenceId = ((Element)terminateSequence.item(0))
+ .getElementsByTagNameNS(WSRM_NS,
"Identifier").item(0).getTextContent().trim();
+ retVal.put("messaging.identifier", sequenceId);
+ }
System.out.println("Properties from message: " + retVal);
return retVal;
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/oneway/OneWayTestCase.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -21,7 +21,13 @@
*/
package org.jboss.test.ws.jaxws.wsrm.oneway;
+import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
import java.net.URL;
+import java.util.Properties;
import java.util.concurrent.TimeUnit;
import javax.xml.namespace.QName;
@@ -43,12 +49,29 @@
*/
public class OneWayTestCase extends JBossWSTest
{
+ private static final Properties props = new Properties();
private String targetNS = "http://wsrm.jaxws.ws.test.jboss.org/";
private OneWayServiceIface proxy;
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
+ private final String serviceURL = "http://" + getServerHost() +
":" + props.getProperty("port") +
props.getProperty("path");
+ static
+ {
+ // load test properties
+ File propertiesFile = new
File("resources/jaxws/wsrm/properties/OneWayTestCase.properties");
+ try
+ {
+ props.load(new FileInputStream(propertiesFile));
+ }
+ catch (IOException ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
+
public static Test suite()
{
- return new JBossWSTestSetup(OneWayTestCase.class, "jaxws-wsrm.war,
jaxws-wsrm-client.jar");
+ return new JBossWSTestSetup(OneWayTestCase.class,
props.getProperty("archives"));
}
@Override
@@ -56,7 +79,7 @@
{
super.setUp();
QName serviceName = new QName(targetNS, "OneWayService");
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-wsrm/OneWayService?wsdl");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
proxy = (OneWayServiceIface)service.getPort(OneWayServiceIface.class);
}
@@ -64,17 +87,28 @@
public void testOneWayMethods() throws Exception
{
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
- RMProvider wsrmProvider = (RMProvider)proxy;
- RMSequence sequence = wsrmProvider.createSequence();
- System.out.println("Created sequence with id=" + sequence.getId());
+ setAddrProps(proxy,
"http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence", serviceURL);
+ RMSequence sequence = null;
+ if (emulatorOn)
+ {
+ RMProvider wsrmProvider = (RMProvider)proxy;
+ sequence = wsrmProvider.createSequence();
+ System.out.println("Created sequence with id=" + sequence.getId());
+ }
+ setAddrProps(proxy, "http://useless/action1", serviceURL);
proxy.method1();
+ setAddrProps(proxy, "http://useless/action2", serviceURL);
proxy.method2("Hello World");
- sequence.setLastMessage();
+ setAddrProps(proxy, "http://useless/action3", serviceURL);
proxy.method3(new String[] {"Hello","World"});
- if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
- fail("Sequence not completed within specified time amount");
- } else {
- sequence.terminate();
+ if (emulatorOn)
+ {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
+ fail("Sequence not completed within specified time amount");
+ } else {
+ setAddrProps(proxy,
"http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence", serviceURL);
+ sequence.terminate();
+ }
}
}
}
Modified:
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/reqres/ReqResTestCase.java 2007-10-29
21:10:36 UTC (rev 4928)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxws.wsrm.reqres;
+import static org.jboss.test.ws.jaxws.wsrm.Helper.*;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -31,11 +33,8 @@
import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.BindingProvider;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
-import javax.xml.ws.addressing.AddressingProperties;
-import javax.xml.ws.addressing.JAXWSAConstants;
import junit.framework.Test;
@@ -43,7 +42,6 @@
import org.jboss.wsf.test.JBossWSTestSetup;
import org.jboss.test.ws.jaxws.wsrm.ReqResServiceIface;
-import org.jboss.ws.extensions.addressing.AddressingClientUtil;
import org.jboss.ws.extensions.wsrm.client_api.RMProvider;
import org.jboss.ws.extensions.wsrm.client_api.RMSequence;
@@ -62,6 +60,7 @@
private Exception handlerException;
private boolean asyncHandlerCalled;
private ReqResServiceIface proxy;
+ private final boolean emulatorOn =
Boolean.parseBoolean((String)props.get("emulator"));
static
{
@@ -170,30 +169,33 @@
private void doReliableMessageExchange(Object proxyObject, InvocationType
invocationType) throws Exception
{
-
setAddressingProperties("http://docs.oasis-open.org/ws-rx/wsrm/20070...;
+ // TODO: do not set this Action here, do it in the JAX-WS WS-RM core code instead
System.out.println("FIXME [JBWS-515] Provide an initial implementation for
WS-ReliableMessaging");
- RMProvider wsrmProvider = (RMProvider)proxyObject;
- RMSequence sequence = wsrmProvider.createSequence();
- System.out.println("Created sequence with id=" + sequence.getId());
- setAddressingProperties("http://useless/action");
+ setAddrProps(proxy,
"http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence", serviceURL);
+ RMSequence sequence = null;
+ if (emulatorOn)
+ {
+ RMProvider wsrmProvider = (RMProvider)proxyObject;
+ sequence = wsrmProvider.createSequence();
+ System.out.println("Created sequence with id=" + sequence.getId());
+ }
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- setAddressingProperties("http://useless/action");
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- sequence.setLastMessage();
- setAddressingProperties("http://useless/action");
+ setAddrProps(proxy, "http://useless/action", serviceURL);
invokeWebServiceMethod(invocationType);
- if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
- sequence.discard();
- fail("Sequence not completed within specified time amount");
- } else {
- sequence.terminate();
+ if (emulatorOn)
+ {
+ if (!sequence.isCompleted(1000, TimeUnit.MILLISECONDS)) {
+ sequence.discard();
+ fail("Sequence not completed within specified time amount");
+ } else {
+ // TODO: do not set this Action here, do it in the JAX-WS WS-RM core code
instead
+ setAddrProps(proxy,
"http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequence", serviceURL);
+ sequence.terminate();
+ }
}
}
- private void setAddressingProperties(String wsaAction) {
- BindingProvider bp = (BindingProvider)proxy;
- AddressingProperties props = AddressingClientUtil.createAnonymousProps(wsaAction,
serviceURL);
- bp.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND,
props);
- }
-
}
Modified:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/web.xml 2007-10-29
21:10:36 UTC (rev 4928)
@@ -11,7 +11,7 @@
<servlet-mapping>
<servlet-name>EndpointEmulator</servlet-name>
- <url-pattern>/ReqResService</url-pattern>
+ <url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl 2007-10-29
21:10:36 UTC (rev 4928)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="OneWayService"
targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xs:schema
targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/"
version="1.0"
xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="method1" type="tns:method1"/>
+ <xs:element name="method2" type="tns:method2"/>
+ <xs:element name="method3" type="tns:method3"/>
+ <xs:complexType name="method1">
+ <xs:sequence/>
+ </xs:complexType>
+ <xs:complexType name="method2">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0"
type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="method3">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0"
name="arg0" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="OneWayServiceIface_method3">
+ <part name="method3" element="tns:method3">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method2">
+ <part name="method2" element="tns:method2">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method1">
+ <part name="method1" element="tns:method1">
+ </part>
+ </message>
+ <portType name="OneWayServiceIface">
+ <operation name="method1">
+ <input message="tns:OneWayServiceIface_method1">
+ </input>
+ </operation>
+ <operation name="method2">
+ <input message="tns:OneWayServiceIface_method2">
+ </input>
+ </operation>
+ <operation name="method3">
+ <input message="tns:OneWayServiceIface_method3">
+ </input>
+ </operation>
+ </portType>
+ <binding name="OneWayServiceIfaceBinding"
type="tns:OneWayServiceIface">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="method1">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method3">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="OneWayService">
+ <port name="OneWayPort"
binding="tns:OneWayServiceIfaceBinding">
+ <soap:address
location="http://127.0.0.1:8080/jaxws-wsrm-emulator/OneWayService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+ <wsp:All>
+ <wsrmp:DeliveryAssurance
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
\ No newline at end of file
Property changes on:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/OneWayService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml 2007-10-29
21:10:36 UTC (rev 4928)
@@ -0,0 +1,15 @@
+<env:Envelope
+
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+
xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+
xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To>${addressing.to}</wsa:To>
+ <wsa:RelatesTo>${addressing.relatesto}</wsa:RelatesTo>
+ <wsa:Action>${addressing.action}</wsa:Action>
+ </env:Header>
+ <env:Body
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <wsrm11:TerminateSequenceResponse>
+ <wsrm11:Identifier>${messaging.identifier}</wsrm11:Identifier>
+ </wsrm11:TerminateSequenceResponse>
+ </env:Body>
+</env:Envelope>
Property changes on:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/emulator/resources/terminateSequenceResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
(rev 0)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties 2007-10-29
21:10:36 UTC (rev 4928)
@@ -0,0 +1,6 @@
+port=8080
+#path=/jaxws-wsrm/OneWayService
+path=/jaxws-wsrm-emulator/OneWayService
+#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
+emulator=true
\ No newline at end of file
Modified:
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
===================================================================
---
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties 2007-10-29
18:44:57 UTC (rev 4927)
+++
stack/native/branches/ropalka/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties 2007-10-29
21:10:36 UTC (rev 4928)
@@ -2,4 +2,5 @@
#path=/jaxws-wsrm/ReqResService
path=/jaxws-wsrm-emulator/ReqResService
#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
\ No newline at end of file
+archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
+emulator=true
\ No newline at end of file