You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by di...@apache.org on 2004/05/05 11:32:21 UTC

cvs commit: ws-fx/wss4j/src/org/apache/ws/axis/security WSDoAllSender.java

dims        2004/05/05 02:32:20

  Modified:    wss4j/lib axis.jar jaxrpc.jar
               wss4j/src/org/apache/ws/axis/security WSDoAllSender.java
  Log:
  Fix for WSFX-1 - WsDoAllSender does not correctly handles international characters
  
  Note: Axis now does not do extra byte<->string conversions.
  
  Revision  Changes    Path
  1.7       +1214 -1235ws-fx/wss4j/lib/axis.jar
  
  	<<Binary file>>
  
  
  1.7       +10 -10    ws-fx/wss4j/lib/jaxrpc.jar
  
  	<<Binary file>>
  
  
  1.12      +10 -10    ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllSender.java
  
  Index: WSDoAllSender.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllSender.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSDoAllSender.java	1 Apr 2004 18:54:24 -0000	1.11
  +++ WSDoAllSender.java	5 May 2004 09:32:20 -0000	1.12
  @@ -48,6 +48,7 @@
   import java.security.cert.X509Certificate;
   
   import java.io.ByteArrayOutputStream;
  +import java.io.UnsupportedEncodingException;
   import java.util.Hashtable;
   import java.util.Vector;
   
  @@ -360,13 +361,7 @@
   		 * The outputDOM() method performs the necessary c14n call. After 
   		 * that we extract it as a string for further processing.
   		 * 
  -		 * Set the resulting string as the new SOAP message.
  -		 * 
  -		 * NOTE: must be set as FORM_STRING, otherwise Axis will serialize
  -		 * the message again. That could change the content of the message
  -		 * and therefore invalidates a signature. It would also not work
  -		 * if the SOAP request contains attachements because Axis couldn't
  -		 * find the references and so on...
  +		 * Set the resulting byte array as the new SOAP message.
   		 * 
   		 * If noSerialization is false, this handler shall be the last 
   		 * (or only) one in a handler chain. 
  @@ -380,12 +375,17 @@
   		} else {
   			ByteArrayOutputStream os = new ByteArrayOutputStream();
   			XMLUtils.outputDOM(doc, os, true);
  -			String osStr = os.toString();
  -			if (doDebug) {
  +            sPart.setCurrentMessage(os.toByteArray(), SOAPPart.FORM_BYTES);
  +            if (doDebug) {
  +                String osStr = null;
  +                try {
  +                    osStr = os.toString("UTF-8");
  +                } catch (UnsupportedEncodingException e) {
  +                    osStr = os.toString();
  +                }
   				log.debug("Send request:");
   				log.debug(osStr);
   			}
  -			sPart.setCurrentMessage(osStr, SOAPPart.FORM_STRING);
   			msgContext.setProperty(WSDoAllConstants.SND_SECURITY, null);
   		}
   		if (doDebug) {