You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2011/08/30 12:45:03 UTC

svn commit: r1163168 - in /cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm: Messages.properties RMManager.java

Author: ay
Date: Tue Aug 30 10:45:02 2011
New Revision: 1163168

URL: http://svn.apache.org/viewvc?rev=1163168&view=rev
Log:
[CXF-3777] WS-RM provider may try to send a CreateSequence message to the anonymous endpoint

Modified:
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties?rev=1163168&r1=1163167&r2=1163168&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Messages.properties Tue Aug 30 10:45:02 2011
@@ -38,6 +38,7 @@ SEQUENCE_CLOSED_EXC = The Sequence has b
 WSRM_REQUIRED_EXC = WS-ReliableMessaging is required by this endpoint.
 UNSUPPORTED_NAMESPACE = WS-Addressing namespace {0} is not supported with WS-ReliableMessaging namespace {1}.
 CREATE_SEQ_REFUSED = The create sequence request has been refused by the RM destination.
+CREATE_SEQ_ANON_TARGET = It is not possible to send a create sequence request to the anonymous address {0}
 
 SEQ_FAULT_MSG = Interceptor encountered a SequenceFault: {0}.
 MAPS_RETRIEVAL_FAILURE_MSG = Failed to retrieve message addressing properties from context - not ensuring reliable delivery.

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?rev=1163168&r1=1163167&r2=1163168&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Tue Aug 30 10:45:02 2011
@@ -55,6 +55,7 @@ import org.apache.cxf.service.model.Serv
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
+import org.apache.cxf.ws.addressing.ContextUtils;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.RelatesToType;
@@ -434,6 +435,14 @@ public class RMManager {
                 }
             }
 
+            if (ContextUtils.isGenericAddress(to)) {
+                org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
+                    "CREATE_SEQ_ANON_TARGET", LOG, 
+                    to != null && to.getAddress() != null 
+                    ? to.getAddress().getValue() : null);
+                LOG.log(Level.INFO, msg.toString());
+                throw new RMException(msg);
+            }
             Proxy proxy = source.getReliableEndpoint().getProxy();
             CreateSequenceResponseType createResponse = proxy.createSequence(acksTo, relatesTo, isServer);
             if (!isServer) {