[WSS4J] wss4j/src/org/apache/ws/axis/security WSDoAllReceiver.java,1.11,1.12

[email protected] Tue, 10 Feb 2004 07:56:00 -0800
Newsgroups gmane.text.xml.wss4j
Message-ID <[email protected]>
Update of /cvsroot/wss4j/wss4j/src/org/apache/ws/axis/security
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14714/src/org/apache/ws/axis/security

Modified Files:
	WSDoAllReceiver.java 
Log Message:
Modify the message update because of a probable Axis fault
during serialization. Perform serialization in handler, set result as
String (same as in WSDoAllSender). Idea came from Sashka.

Index: WSDoAllReceiver.java
===================================================================
RCS file: /cvsroot/wss4j/wss4j/src/org/apache/ws/axis/security/WSDoAllReceiver.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- WSDoAllReceiver.java	7 Feb 2004 20:04:03 -0000	1.11
+++ WSDoAllReceiver.java	10 Feb 2004 15:55:56 -0000	1.12
@@ -66,6 +66,7 @@
 import org.apache.axis.AxisFault;
 import org.apache.axis.Message;
 import org.apache.axis.MessageContext;
+import org.apache.axis.SOAPPart;
 import org.apache.axis.handlers.BasicHandler;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -75,11 +76,13 @@
 import org.apache.ws.security.WSSecurityEngineResult;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.components.crypto.CryptoFactory;
+import org.apache.xml.security.utils.XMLUtils;
 import org.w3c.dom.Document;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPHeaderElement;
+import java.io.ByteArrayOutputStream;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Vector;
@@ -211,13 +214,27 @@
 				"WSDoAllReceiver: security processing failed",
 				ex);
 		}
+
+		SOAPPart sPart = (org.apache.axis.SOAPPart) sm.getSOAPPart();
+		
+		ByteArrayOutputStream os = new ByteArrayOutputStream();
+		XMLUtils.outputDOM(doc, os, true);
+		String osStr = os.toString();
+		if (doDebug) {
+			log.debug(osStr);
+		}
+		sPart.setCurrentMessage(osStr, SOAPPart.FORM_STRING);
+
+		/*		
 		try {
 			AxisUtil.updateSOAPMessage(doc, sm);
+			
 		} catch (Exception ex) {
 			throw new AxisFault(
 				"WSDoAllReceiver: cannot update processed message",
 				ex);
 		}
+		*/
 		Vector resultActions = wsResult.getActions();
 		int size = actions.size();
 		if (size != resultActions.size()) {



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn