You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2006/09/28 20:05:42 UTC
svn commit: r450948 -
/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java
Author: ruchithf
Date: Thu Sep 28 11:05:42 2006
New Revision: 450948
URL: http://svn.apache.org/viewvc?view=rev&rev=450948
Log:
Makesure we set the security header as processed after security processing
Modified:
webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java
Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java?view=diff&rev=450948&r1=450947&r2=450948
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/handler/RampartReceiver.java Thu Sep 28 11:05:42 2006
@@ -16,7 +16,10 @@
package org.apache.rampart.handler;
+import org.apache.axiom.om.OMException;
import org.apache.axiom.om.impl.dom.jaxp.DocumentBuilderFactoryImpl;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.description.HandlerDescription;
@@ -26,6 +29,7 @@
import org.apache.rampart.RampartException;
import org.apache.rampart.util.Axis2Util;
import org.apache.ws.secpolicy.WSSPolicyException;
+import org.apache.ws.security.WSConstants;
import org.apache.ws.security.WSSecurityEngine;
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.WSHandlerConstants;
@@ -33,6 +37,7 @@
import javax.xml.namespace.QName;
+import java.util.Iterator;
import java.util.Vector;
@@ -94,6 +99,31 @@
}
WSHandlerResult rResult = new WSHandlerResult("", wsResult);
results.add(0, rResult);
+
+ SOAPHeader header = null;
+ try {
+ header = msgContext.getEnvelope().getHeader();
+ } catch (OMException ex) {
+ throw new AxisFault(
+ "WSDoAllReceiver: cannot get SOAP header after security processing",
+ ex);
+ }
+
+ Iterator headers = header.getChildElements();
+
+ SOAPHeaderBlock headerBlock = null;
+
+ while (headers.hasNext()) { // Find the wsse header
+ SOAPHeaderBlock hb = (SOAPHeaderBlock) headers.next();
+ if (hb.getLocalName().equals(WSConstants.WSSE_LN)
+ && hb.getNamespace().getNamespaceURI().equals(WSConstants.WSSE_NS)) {
+ headerBlock = hb;
+ break;
+ }
+ }
+
+ headerBlock.setProcessed();
+
}
public HandlerDescription getHandlerDesc() {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org