You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/01/08 15:14:21 UTC
svn commit: r897211 - in /cxf/branches/2.1.x-fixes: ./
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/
rt/core/src/main/java/org/apache/cxf/interceptor/ rt/fronten...
Author: dkulp
Date: Fri Jan 8 14:14:21 2010
New Revision: 897211
URL: http://svn.apache.org/viewvc?rev=897211&view=rev
Log:
Merged revisions 896904 via svnmerge from
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................
r896904 | dkulp | 2010-01-07 10:33:20 -0500 (Thu, 07 Jan 2010) | 10 lines
Merged revisions 896888 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r896888 | dkulp | 2010-01-07 09:14:50 -0500 (Thu, 07 Jan 2010) | 2 lines
[CXF-2594] During unwind on faults during output, with SAAJ, we can
really fully unwind.
........
................
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
cxf/branches/2.1.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?rev=897211&r1=897210&r2=897211&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Fri Jan 8 14:14:21 2010
@@ -76,7 +76,8 @@
public void handleMessage(SoapMessage message) {
// Yes this is ugly, but it avoids us from having to implement any kind of caching strategy
- if (!MessageUtils.isTrue(message.get(WROTE_ENVELOPE_START))) {
+ boolean wroteStart = MessageUtils.isTrue(message.get(WROTE_ENVELOPE_START));
+ if (!wroteStart) {
writeSoapEnvelopeStart(message);
OutputStream os = message.getContent(OutputStream.class);
Modified: cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java?rev=897211&r1=897210&r2=897211&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java Fri Jan 8 14:14:21 2010
@@ -42,6 +42,7 @@
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.SoapVersion;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.helpers.CastUtils;
@@ -127,6 +128,9 @@
@Override
public void handleFault(SoapMessage message) {
super.handleFault(message);
+ //need to clear these so the fault writing will work correctly
+ message.removeContent(SOAPMessage.class);
+ message.remove(SoapOutInterceptor.WROTE_ENVELOPE_START);
XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER);
if (writer != null) {
message.setContent(XMLStreamWriter.class, writer);
Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=897211&r1=897210&r2=897211&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java Fri Jan 8 14:14:21 2010
@@ -36,7 +36,8 @@
*
*/
public class LoggingOutInterceptor extends AbstractPhaseInterceptor {
-
+ private static final String LOG_SETUP = LoggingOutInterceptor.class.getName() + ".log-setup";
+
private static final Logger LOG = LogUtils.getL7dLogger(LoggingOutInterceptor.class);
private int limit = 100 * 1024;
@@ -75,9 +76,13 @@
if (LOG.isLoggable(Level.INFO) || writer != null) {
// Write the output while caching it for the log message
- final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(os);
- message.setContent(OutputStream.class, newOut);
- newOut.registerCallback(new LoggingCallback(message, os));
+ boolean hasLogged = message.containsKey(LOG_SETUP);
+ if (!hasLogged) {
+ message.put(LOG_SETUP, Boolean.TRUE);
+ final CacheAndWriteOutputStream newOut = new CacheAndWriteOutputStream(os);
+ message.setContent(OutputStream.class, newOut);
+ newOut.registerCallback(new LoggingCallback(message, os));
+ }
}
}
Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?rev=897211&r1=897210&r2=897211&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java (original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java Fri Jan 8 14:14:21 2010
@@ -283,6 +283,9 @@
}
public void handleFault(SoapMessage message) {
+ if (getInvoker(message).getProtocolHandlers().isEmpty()) {
+ return;
+ }
if (getInvoker(message).isOutbound()
&& !chainAlreadyContainsSAAJ(message)) {
SAAJ_OUT.handleFault(message);
Modified: cxf/branches/2.1.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java?rev=897211&r1=897210&r2=897211&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ cxf/branches/2.1.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Fri Jan 8 14:14:21 2010
@@ -510,8 +510,11 @@
*/
public void prepare(Message message) throws IOException {
message.put(HTTP_RESPONSE, response);
- message.setContent(OutputStream.class,
+ OutputStream os = message.getContent(OutputStream.class);
+ if (os == null) {
+ message.setContent(OutputStream.class,
new WrappedOutputStream(message, response));
+ }
}
}