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 di...@apache.org on 2005/06/07 05:01:38 UTC
cvs commit: ws-axis/java/src/org/apache/axis SOAPPart.java
dims 2005/06/06 20:01:38
Modified: java/src/org/apache/axis/handlers HandlerChainImpl.java
java/src/org/apache/axis SOAPPart.java
Log:
Fix for interop.TestJAXRPCHandler failure in WSS4J
Revision Changes Path
1.19 +19 -16 ws-axis/java/src/org/apache/axis/handlers/HandlerChainImpl.java
Index: HandlerChainImpl.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/handlers/HandlerChainImpl.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- HandlerChainImpl.java 14 Feb 2005 04:05:42 -0000 1.18
+++ HandlerChainImpl.java 7 Jun 2005 03:01:38 -0000 1.19
@@ -190,24 +190,27 @@
}
private void postInvoke(SOAPMessageContext msgContext) {
- msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
- Boolean.TRUE);
- SOAPMessage message = msgContext.getMessage();
- ArrayList oldList =
- (ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO);
- if (oldList != null) {
- if (!Arrays.equals(oldList.toArray(), getMessageInfo(message)
- .toArray())) {
- throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00"));
+ Boolean propFormOptimization = (Boolean)msgContext.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION);
+ if (propFormOptimization != null && !propFormOptimization.booleanValue()) {
+ msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
+ Boolean.TRUE);
+ SOAPMessage message = msgContext.getMessage();
+ ArrayList oldList =
+ (ArrayList)msgContext.getProperty(JAXRPC_METHOD_INFO);
+ if (oldList != null) {
+ if (!Arrays.equals(oldList.toArray(), getMessageInfo(message)
+ .toArray())) {
+ throw new RuntimeException(Messages.getMessage("invocationArgumentsModified00"));
+ }
}
- }
- try {
- if (message != null) {
- message.saveChanges();
+ try {
+ if (message != null) {
+ message.saveChanges();
+ }
+ } catch (SOAPException e) {
+ log.debug("Exception in postInvoke : ", e);
+ throw new RuntimeException("Exception in postInvoke : " + e.toString());
}
- } catch (SOAPException e) {
- log.debug("Exception in postInvoke : ", e);
- throw new RuntimeException("Exception in postInvoke : " + e.toString());
}
}
1.80 +17 -1 ws-axis/java/src/org/apache/axis/SOAPPart.java
Index: SOAPPart.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/SOAPPart.java,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- SOAPPart.java 24 May 2005 03:55:24 -0000 1.79
+++ SOAPPart.java 7 Jun 2005 03:01:38 -0000 1.80
@@ -256,7 +256,6 @@
* Write the contents to the specified stream.
*
* @param os the <code>java.io.OutputStream</code> to write to
- * @param charEncoding
*/
public void writeTo(java.io.OutputStream os) throws IOException {
if ( currentForm == FORM_BYTES ) {
@@ -837,6 +836,17 @@
if(source == null)
throw new SOAPException(Messages.getMessage("illegalArgumentException00"));
+ // override the checks in HandlerChainImpl for JAXRPCHandler kludge
+ Object formOptimization = null;
+ MessageContext ctx = getMessage().getMessageContext();
+ if (ctx != null) {
+ formOptimization = ctx.getProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION);
+ if(formOptimization != null) {
+ ctx.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
+ Boolean.TRUE);
+ }
+ }
+
contentSource = source;
InputSource in = org.apache.axis.utils.XMLUtils.sourceToInputSource(contentSource);
InputStream is = in.getByteStream();
@@ -859,6 +869,12 @@
}
setCurrentMessage(sb.toString(), FORM_STRING);
}
+
+ // reset the original value
+ if(formOptimization != null) {
+ ctx.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
+ formOptimization);
+ }
}
/**