You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2007/01/17 17:15:00 UTC

svn commit: r497060 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ addressing/test/org/apache/axis2/handlers/addressing/ integration/conf/ integration/test-resources/security/ kernel/src/org/apache/axis...

Author: pradine
Date: Wed Jan 17 08:14:58 2007
New Revision: 497060

URL: http://svn.apache.org/viewvc?view=rev&rev=497060
Log:
Changes related to AXIS2-1516. The wsa:To and wsa:ReplyTo headers are now omitted if they contain a wsa anonymous address. This applies to the 2005/08 adressing namespace only. In addition, the RelationshipType attribute is now omitted if the value is wsa reply. This applies to both namespaces.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
    webservices/axis2/trunk/java/modules/integration/conf/axis2.xml
    webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml
    webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java Wed Jan 17 08:14:58 2007
@@ -209,17 +209,7 @@
                 soapHeaderBlock.getAttribute(
                         new QName(AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
         
-        String relationshipTypeString = null;
-        
-        // If an attribute was found, use the value from it 
-        if(relationshipType!=null){
-            relationshipTypeString = relationshipType.getAttributeValue();
-        }else{ // Else use the appropriate default (depends on namespace in use)
-            relationshipTypeString =
-                Submission.WSA_NAMESPACE.equals(addressingNamespace)
-                        ? Submission.WSA_DEFAULT_RELATIONSHIP_TYPE
-                        : Final.WSA_DEFAULT_RELATIONSHIP_TYPE;
-        }
+        String relationshipTypeString = relationshipType == null ? null : relationshipType.getAttributeValue();
         
         if(log.isTraceEnabled()){
             log.trace("extractRelatesToInformation: Extracted Relationship. Value="+address+" RelationshipType="+relationshipTypeString);

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Wed Jan 17 08:14:58 2007
@@ -27,6 +27,7 @@
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axiom.soap.SOAPHeaderBlock;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.AddressingFaultsHelper;
 import org.apache.axis2.addressing.EndpointReference;
@@ -34,6 +35,7 @@
 import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.Utils;
@@ -54,7 +56,7 @@
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
         // it should be able to disable addressing by some one.
         Object property = msgContext.getProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
-        if (property != null && JavaUtils.isTrueExplicitly(property)) {
+        if (JavaUtils.isTrueExplicitly(property)) {
             log.debug("Addressing is disabled .....");
             return InvocationResponse.CONTINUE;
         }
@@ -68,6 +70,13 @@
             namespace = Submission.WSA_NAMESPACE;
         }
         
+        //Determine whether to include optional addressing headers in the output message.
+        //The default is not to include any headers that can be safely omitted.
+        boolean includeOptionalHeaders = false;
+        Parameter param = msgContext.getModuleParameter(INCLUDE_OPTIONAL_HEADERS, Constants.MODULE_ADDRESSING, getHandlerDesc());
+        String value = Utils.getParameterValue(param);
+        includeOptionalHeaders = JavaUtils.isTrueExplicitly(value);
+        
         SOAPFactory factory = (SOAPFactory) msgContext.getEnvelope().getOMFactory();
         OMNamespace addressingNamespaceObject = factory.createOMNamespace(namespace, WSA_DEFAULT_PREFIX);
 
@@ -97,16 +106,16 @@
         }
 
         // processing WSA To
-        processToEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+        processToEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
 
         // processing WSA replyTo
-        processReplyTo(envelope, messageContextOptions, msgContext, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+        processReplyTo(envelope, messageContextOptions, msgContext, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
         
         // processing WSA From
-        processFromEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+        processFromEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
 
         // processing WSA FaultTo
-        processFaultToEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+        processFaultToEPR(messageContextOptions, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
 
         // processing WSA MessageID
         processMessageID(messageContextOptions, envelope, msgContext, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
@@ -115,7 +124,7 @@
         processWSAAction(messageContextOptions, envelope, msgContext, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
 
         // processing WSA RelatesTo
-        processRelatesTo(envelope, messageContextOptions, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+        processRelatesTo(envelope, messageContextOptions, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
 
         // process fault headers, if present
         processFaultsInfoIfPresent(envelope, msgContext, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
@@ -218,7 +227,7 @@
         }
     }
 
-    private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) {
+    private void processRelatesTo(SOAPEnvelope envelope, Options messageContextOptions, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) {
         if (!isAddressingHeaderAlreadyAvailable(WSA_RELATES_TO, envelope, addressingNamespaceObject, replaceHeaders))
         {
             RelatesTo[] relatesTo = messageContextOptions.getRelationships();
@@ -230,64 +239,66 @@
                     String relationshipType = relatesTo[i].getRelationshipType();
 
                     if (relatesToHeader != null) {
+                        if(relatesTo[i].getExtensibilityAttributes() != null){
+                            Iterator attributes = relatesTo[i].getExtensibilityAttributes().iterator();
+                            while(attributes.hasNext()){
+                                OMAttribute oma = (OMAttribute)attributes.next();
+                                AttributeHelper.importOMAttribute(oma, relatesToHeader);
+                            }
+                        }
                         
-                        // I think that if it's one of these two constants we can just not add the attribute
-                        // which would save some small amount of bandwidth and processing.
                         if (Final.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType) ||
                             Submission.WSA_DEFAULT_RELATIONSHIP_TYPE.equals(relationshipType)) {
-                            relationshipType = isFinalAddressingNamespace ?
-                                    Final.WSA_DEFAULT_RELATIONSHIP_TYPE : Submission.WSA_DEFAULT_RELATIONSHIP_TYPE;
+                            if (!includeOptionalHeaders) {
+                                continue; //Omit the relationship type
+                            }
+                            else {
+                                relationshipType = isFinalAddressingNamespace ?
+                                        Final.WSA_DEFAULT_RELATIONSHIP_TYPE : Submission.WSA_DEFAULT_RELATIONSHIP_TYPE;
+                            }
                         }
                         
                         relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
                                 relationshipType,
                                 null);
-                        
-                        if(relatesTo[i].getExtensibilityAttributes() != null){
-                            Iterator attributes = relatesTo[i].getExtensibilityAttributes().iterator();
-                            while(attributes.hasNext()){
-                                OMAttribute oma = (OMAttribute)attributes.next();
-                                AttributeHelper.importOMAttribute(oma, relatesToHeader);
-                            }
-                        }
                     }
                 }
             }
         }
     }
 
-    private void processFaultToEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) throws AxisFault {
+    private void processFaultToEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) throws AxisFault {
         EndpointReference epr = messageContextOptions.getFaultTo();
         String headerName = AddressingConstants.WSA_FAULT_TO;
         
         //Omit the header if the epr is null.
         if (epr != null && !isAddressingHeaderAlreadyAvailable(headerName, envelope, addressingNamespaceObject, replaceHeaders)) {
-            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
         }
     }
 
-    private void processFromEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) throws AxisFault {
+    private void processFromEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) throws AxisFault {
         EndpointReference epr = messageContextOptions.getFrom();
         String headerName = AddressingConstants.WSA_FROM;
         
         //Omit the header if the epr is null.
         if (epr != null && !isAddressingHeaderAlreadyAvailable(headerName, envelope, addressingNamespaceObject, replaceHeaders)) {
-            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);
+            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);
         }
     }
 
-    private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext msgContext, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) throws AxisFault {
+    private void processReplyTo(SOAPEnvelope envelope, Options messageContextOptions, MessageContext msgContext, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) throws AxisFault {
         EndpointReference epr = messageContextOptions.getReplyTo();
         String headerName = AddressingConstants.WSA_REPLY_TO;
         
         //Don't check epr for null here as addToSOAPHeader() will provide an appropriate default.
         //This default is especially useful for client side outbound processing.
         if (!isAddressingHeaderAlreadyAvailable(headerName, envelope, addressingNamespaceObject, replaceHeaders)) {
-            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace);            
+            addToSOAPHeader(epr, headerName, envelope, addressingNamespaceObject, replaceHeaders, isFinalAddressingNamespace, includeOptionalHeaders);            
         }
     }
 
-    private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) {
+    private void processToEPR(Options messageContextOptions, SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) {
         EndpointReference epr = messageContextOptions.getTo();
         if (epr != null && !isAddressingHeaderAlreadyAvailable(WSA_TO, envelope, addressingNamespaceObject, replaceHeaders))
         {
@@ -295,6 +306,12 @@
             String address = epr.getAddress();
 
             if (!"".equals(address) && address != null) {
+                if (!includeOptionalHeaders && isFinalAddressingNamespace &&
+                    (Final.WSA_ANONYMOUS_URL.equals(address) ||      //Don't use epr.hasAnonymousAddress() here as it may
+                    Submission.WSA_ANONYMOUS_URL.equals(address))) { //recognize none WS-Addressing anonymous values.
+                    return; //Omit the header.
+                }
+                        
                 SOAPHeaderBlock toHeaderBlock = envelope.getHeader().addHeaderBlock(WSA_TO, addressingNamespaceObject);
                 toHeaderBlock.setText(address);
                 if(epr.getAddressAttributes() != null){
@@ -325,21 +342,34 @@
 
     private void addToSOAPHeader(EndpointReference epr,
                                  String headerName,
-                                 SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace) throws AxisFault {
+                                 SOAPEnvelope envelope, OMNamespace addressingNamespaceObject, boolean replaceHeaders, boolean isFinalAddressingNamespace, boolean includeOptionalHeaders) throws AxisFault {
         String namespace = addressingNamespaceObject.getNamespaceURI();
         String prefix = addressingNamespaceObject.getPrefix();
         String anonymous = isFinalAddressingNamespace ?
                 Final.WSA_ANONYMOUS_URL : Submission.WSA_ANONYMOUS_URL;
 
         if (epr == null) {
-            epr = new EndpointReference(anonymous);
+            if (!includeOptionalHeaders && isFinalAddressingNamespace &&
+                AddressingConstants.WSA_REPLY_TO.equals(headerName)) {
+                return; //Omit the header.
+            }
+            else {
+                epr = new EndpointReference(anonymous);
+            }
         }
         else if (!isFinalAddressingNamespace && epr.hasNoneAddress()) {
             return; //Omit the header.
         }
         else if (Final.WSA_ANONYMOUS_URL.equals(epr.getAddress()) ||      //Don't use epr.hasAnonymousAddress() here as it may
                  Submission.WSA_ANONYMOUS_URL.equals(epr.getAddress())) { //recognize none WS-Addressing anonymous values.
-            epr.setAddress(anonymous);                                    
+            
+            if (!includeOptionalHeaders && isFinalAddressingNamespace &&
+                AddressingConstants.WSA_REPLY_TO.equals(headerName)) {
+                return; //Omit the header.
+            }
+            else {
+                epr.setAddress(anonymous);
+            }
         }
 
         OMElement soapHeaderBlock = EndpointReferenceHelper.toOM(envelope.getOMFactory(), 

Modified: webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java (original)
+++ webservices/axis2/trunk/java/modules/addressing/test/org/apache/axis2/handlers/addressing/AddressingOutHandlerTest.java Wed Jan 17 08:14:58 2007
@@ -29,6 +29,8 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.handlers.util.TestUtil;
 
@@ -66,6 +68,7 @@
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
 
         MessageContext msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
         msgCtxt.setProperty(WS_ADDRESSING_VERSION, Submission.WSA_NAMESPACE);
         msgCtxt.setTo(epr);
         msgCtxt.setReplyTo(replyTo);
@@ -94,6 +97,7 @@
 
     public void testHeaderCreationFromMsgCtxtInformation() throws Exception {
         msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
 
         EndpointReference epr = new EndpointReference("http://www.from.org/service/");
         epr.addReferenceParameter(new QName("Reference2"),
@@ -134,6 +138,7 @@
 
     public void testMustUnderstandSupport() throws Exception {
         msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
 
         msgCtxt.setProperty(AddressingConstants.ADD_MUST_UNDERSTAND_TO_ADDRESSING_HEADERS, Boolean.TRUE);
         
@@ -174,12 +179,13 @@
                 .getDocumentElement()));
     }
 
-    public void testDuplicateHeaders() throws AxisFault {
+    public void testDuplicateHeaders() throws Exception {
 
         // this will check whether we can add to epr, if there is one already.
         EndpointReference eprOne = new EndpointReference("http://whatever.org");
         EndpointReference duplicateEpr = new EndpointReference("http://whatever.duplicate.org");
         msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
         msgCtxt.setEnvelope(defaultEnvelope);
@@ -198,11 +204,12 @@
 
     }
 
-    public void testDuplicateHeadersWithOverridingOn() throws AxisFault {
+    public void testDuplicateHeadersWithOverridingOn() throws Exception {
 
         // this will check whether we can add to epr, if there is one already.
         EndpointReference eprOne = new EndpointReference("http://whatever.org");
         msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
         SOAPHeaderBlock soapHeaderBlock =
@@ -221,11 +228,12 @@
 
     }
 
-    public void testDuplicateHeadersWithOverridingOff() throws AxisFault {
+    public void testDuplicateHeadersWithOverridingOff() throws Exception {
 
         // this will check whether we can add to epr, if there is one already.
         EndpointReference eprOne = new EndpointReference("http://whatever.org");
         msgCtxt = new MessageContext();
+        msgCtxt.setConfigurationContext(ConfigurationContextFactory.createDefaultConfigurationContext());
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope defaultEnvelope = factory.getDefaultEnvelope();
         SOAPHeaderBlock soapHeaderBlock =

Modified: webservices/axis2/trunk/java/modules/integration/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/conf/axis2.xml?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/conf/axis2.xml Wed Jan 17 08:14:58 2007
@@ -183,9 +183,9 @@
     <module ref="addressing"/>
 
     <!--Configuring module , providing parameters for modules whether they refer or not-->
-    <!--<moduleConfig name="addressing">-->
-    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
-    <!--</moduleConfig>-->
+    <moduleConfig name="addressing">
+        <parameter name="includeOptionalHeaders" locked="false">true</parameter>
+    </moduleConfig>
 
     <!-- ================================================= -->
     <!-- Phases  -->

Modified: webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.client.axis2.xml Wed Jan 17 08:14:58 2007
@@ -6,6 +6,11 @@
 
     <module ref="addressing"/>
 
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <moduleConfig name="addressing">
+        <parameter name="includeOptionalHeaders" locked="false">true</parameter>
+    </moduleConfig>
+
     <!-- Test with addressing and MTOM: Client's Configuration:START-->
 
     <parameter name="OutflowSecurity">

Modified: webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/security/complete.service.axis2.xml Wed Jan 17 08:14:58 2007
@@ -11,6 +11,11 @@
     <!-- Engage the security module -->
     <module ref="rampart"/>
 
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <moduleConfig name="addressing">
+        <parameter name="includeOptionalHeaders" locked="false">true</parameter>
+    </moduleConfig>
+
     <!-- ================================================= -->
     <!-- Transport Ins -->
     <!-- ================================================= -->

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/AddressingConstants.java Wed Jan 17 08:14:58 2007
@@ -81,6 +81,12 @@
     public static final String MESSAGEID_ATTRIBUTES = "messageidAttributes";
     
     /**
+     * When set to Boolean.TRUE this will cause the addressing out handler to output all
+     * populated addressing headers in a message, including any optional ones.
+     */
+    public static final String INCLUDE_OPTIONAL_HEADERS = "includeOptionalHeaders";
+    
+    /**
      * This property, if set to Boolean.TRUE, will mean that the addressing handler allows partially
      * ws-addressed messages to be sent even if they are then invalid rather than throwing a fault.
      * 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java?view=diff&rev=497060&r1=497059&r2=497060
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MessageContextBuilder.java Wed Jan 17 08:14:58 2007
@@ -118,10 +118,16 @@
             targetResolver.resolveTarget(newmsgCtx);
         }
 
-        // Determine ReplyTo for respome message. Normally 'None URI' but has a value if SOAP Session support is in use
+        // Determine ReplyTo for respome message.
         AxisService axisService = inMessageContext.getAxisService();
         if (axisService != null && Constants.SCOPE_SOAP_SESSION.equals(axisService.getScope())) {
-            newmsgCtx.setReplyTo(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
+            //If the wsa 2004/08 (submission) spec is in effect use the wsa anonymous URI as the default replyTo value.
+            //This is necessary because the wsa none URI is not available in that spec.
+            if (AddressingConstants.Submission.WSA_NAMESPACE.equals(inMessageContext.getProperty(AddressingConstants.WS_ADDRESSING_VERSION)))
+                newmsgCtx.setReplyTo(new EndpointReference(AddressingConstants.Submission.WSA_ANONYMOUS_URL));
+            else
+                newmsgCtx.setReplyTo(new EndpointReference(AddressingConstants.Final.WSA_NONE_URI));
+            
             // add the service group id as a reference parameter
             String serviceGroupContextId = inMessageContext.getServiceGroupContextId();
             if (serviceGroupContextId != null && !"".equals(serviceGroupContextId)) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org