axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r382431 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ core/src/org/apache/axis2/addressing/
Date Thu, 02 Mar 2006 16:11:18 GMT
Author: chinthaka
Date: Thu Mar  2 08:11:17 2006
New Revision: 382431

URL: http://svn.apache.org/viewcvs?rev=382431&view=rev
Log:
Improving addressing in handler
making ProblemHeaderQName part of the fault detail

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/core/src/org/apache/axis2/addressing/AddressingConstants.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=382431&r1=382430&r2=382431&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
Thu Mar  2 08:11:17 2006
@@ -129,9 +129,7 @@
 
             faultInformation.put(Final.FAULT_HEADER_PROB_HEADER_QNAME, "wsa:" + addressingHeaderName);
             faultInformation.put(Final.WSA_FAULT_ACTION, Final.WSA_FAULT_ACTION);
-            if (messageContext.isSOAP11()) {
-                throw new AxisFault("A header representing a Message Addressing Property
is not valid and the message cannot be processed", addressingNSObject.getPrefix() + ":" +
Final.FAULT_INVALID_HEADER);
-            } else {
+            if (!messageContext.isSOAP11()) {
                 SOAPFactory soapFac = OMAbstractFactory.getSOAP12Factory();
                 SOAPFaultCode soapFaultCode = soapFac.createSOAPFaultCode();
                 SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
@@ -140,8 +138,9 @@
                 SOAPFaultValue soapFaultSubcodeValue = soapFac.createSOAPFaultValue(soapFaultSubCode);
                 soapFaultSubcodeValue.setText(addressingNSObject.getPrefix() + ":" + Final.FAULT_INVALID_HEADER);
                 messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, soapFaultCode);
-                throw new AxisFault("A header representing a Message Addressing Property
is not valid and the message cannot be processed", addressingNSObject.getPrefix() + ":" +
Final.FAULT_INVALID_HEADER);
             }
+            throw new AxisFault("A header representing a Message Addressing Property is not
valid and the message cannot be processed", addressingNSObject.getPrefix() + ":" + Final.FAULT_INVALID_HEADER);
+
         } 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=382431&r1=382430&r2=382431&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
Thu Mar  2 08:11:17 2006
@@ -31,6 +31,7 @@
 import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.soap.SOAPEnvelope;
 import org.apache.ws.commons.soap.SOAPFactory;
+import org.apache.ws.commons.soap.SOAPFault;
 import org.apache.ws.commons.soap.SOAPHeader;
 import org.apache.ws.commons.soap.SOAPHeaderBlock;
 import org.apache.wsdl.WSDLConstants;
@@ -152,9 +153,18 @@
         if (faultInfo != null) {
             String faultyHeaderQName = (String) faultInfo.get(Final.FAULT_HEADER_PROB_HEADER_QNAME);
             if (faultyHeaderQName != null && !"".equals(faultyHeaderQName)) {
+                // add to header
                 SOAPHeaderBlock faultDetail = envelope.getHeader().addHeaderBlock(Final.FAULT_HEADER_DETAIL,
addressingNamespaceObject);
                 OMElement probHeaderQName = OMAbstractFactory.getOMFactory().createOMElement(Final.FAULT_HEADER_PROB_HEADER_QNAME,
addressingNamespaceObject, faultDetail);
                 probHeaderQName.setText(faultyHeaderQName);
+
+                // add to header
+                SOAPFault fault = envelope.getBody().getFault();
+                if (fault != null && fault.getDetail() != null) {
+                    OMElement probHeaderQName2 = OMAbstractFactory.getOMFactory().createOMElement(Final.FAULT_HEADER_PROB_HEADER_QNAME,
addressingNamespaceObject, fault.getDetail());
+                    probHeaderQName2.setText(faultyHeaderQName);
+                }
+
             }
 
         }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/AddressingConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/AddressingConstants.java?rev=382431&r1=382430&r2=382431&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/AddressingConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/addressing/AddressingConstants.java
Thu Mar  2 08:11:17 2006
@@ -66,6 +66,7 @@
 
         // fault information
         public static final String FAULT_HEADER_PROB_HEADER_QNAME = "ProblemHeaderQName";
+        public static final String FAULT_HEADER_PROB_HEADER = "ProblemHeader";
         public static final String FAULT_HEADER_DETAIL = "FaultDetail";
         public static final String FAULT_INVALID_HEADER = "InvalidAddressingHeader";
 



Mime
View raw message