axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r382303 - in /webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing: AddressingInHandler.java AddressingOutHandler.java
Date Thu, 02 Mar 2006 05:36:29 GMT
Author: chinthaka
Date: Wed Mar  1 21:36:07 2006
New Revision: 382303

URL: http://svn.apache.org/viewcvs?rev=382303&view=rev
Log:
Adding Addressing fault action if there is an addressing exception

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

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=382303&r1=382302&r2=382303&view=diff
==============================================================================
--- 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 Mar  1 21:36:07 2006
@@ -26,6 +26,8 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMAttribute;
+import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAP12Constants;
 import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPFaultReason;
@@ -42,7 +44,7 @@
 public abstract class AddressingInHandler extends AddressingHandler implements AddressingConstants
{
 
     private static final long serialVersionUID = 3907988439637261572L;
-
+    private OMNamespace addressingNamespaceObject;
 
     public void invoke(MessageContext msgContext) throws AxisFault {
         SOAPHeader header = msgContext.getEnvelope().getHeader();
@@ -59,7 +61,7 @@
             addressingHeaders = header.getHeaderBlocksWithNSURI(addressingNamespace);
             if (addressingHeaders != null && addressingHeaders.size() > 0) {
                 msgContext.setProperty(WS_ADDRESSING_VERSION, addressingNamespace);
-
+                addressingNamespaceObject = ((OMElement) addressingHeaders.get(0)).findNamespace(addressingNamespace,
null);
                 logger.debug(addressingVersion + " Headers present in the SOAP message. Starting
to process ...");
                 extractAddressingInformation(header, msgContext,
                         addressingHeaders, addressingNamespace);
@@ -123,7 +125,8 @@
                 faultInformation = new HashMap();
                 messageContext.setProperty(Constants.FAULT_INFORMATION_FOR_HEADERS, faultInformation);
             }
-            faultInformation.put(Final.FAULT_HEADER_PROB_HEADER_QNAME, "wsa:" + addressingHeaderName);
+            faultInformation.put(Final.FAULT_HEADER_PROB_HEADER_QNAME, addressingNamespaceObject.getPrefix()
+ ":" + addressingHeaderName);
+            faultInformation.put(Final.WSA_FAULT_ACTION, Final.WSA_FAULT_ACTION);
             return true;
         } else {
             alreadyFoundAddressingHeaders.put(addressingHeaderName, addressingHeaderName);

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=382303&r1=382302&r2=382303&view=diff
==============================================================================
--- 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 Mar  1 21:36:07 2006
@@ -149,6 +149,11 @@
                 OMElement probHeaderQName = OMAbstractFactory.getOMFactory().createOMElement(Final.FAULT_HEADER_PROB_HEADER_QNAME,
addressingNamespaceObject, faultDetail);
                 probHeaderQName.setText(faultyHeaderQName);
             }
+
+            String wsaFaultAction = (String) faultInfo.get(Final.WSA_FAULT_ACTION);
+            if (wsaFaultAction != null && !"".equals(wsaFaultAction)) {
+                processStringInfo(wsaFaultAction, WSA_ACTION, envelope);
+            }
         }
     }
 
@@ -238,8 +243,8 @@
 //                    referenceParameters = faultTo.getAllReferenceParameters();
 //                }
 //            } else {
-                address = epr.getAddress();
-                referenceParameters = epr.getAllReferenceParameters();
+            address = epr.getAddress();
+            referenceParameters = epr.getAllReferenceParameters();
 //            }
 
             if (!"".equals(address) && address != null) {



Mime
View raw message