cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r667660 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/staxutils/ common/common/src/test/java/org/apache/cxf/staxutils/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/ rt/core/src/main/java/org/apache/cxf/inter...
Date Fri, 13 Jun 2008 21:27:31 GMT
Author: dkulp
Date: Fri Jun 13 14:27:30 2008
New Revision: 667660

URL: http://svn.apache.org/viewvc?rev=667660&view=rev
Log:
[CXF-1538] Bunch of fixes to get saaj messages written out to the xmlstreamwriter instead
of directly to the stream

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
    cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxOutInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
Fri Jun 13 14:27:30 2008
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.staxutils;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +28,8 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.w3c.dom.Document;
+
 /**
  * Abstract logic for creating XMLStreamReader from DOM documents. Its works
  * using adapters for Element, Node and Attribute (
@@ -72,6 +75,15 @@
             this.element = element;
             this.parent = parent;
         }
+        public ElementFrame(Document doc) {
+            this.element = doc;
+            parent = null;
+            started = true;
+            attributes = Collections.emptyList();
+            prefixes = Collections.emptyList();
+            uris = Collections.emptyList();
+            allAttributes = Collections.emptyList();
+        }
         
         public Object getElement() {
             return element;

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Fri Jun
13 14:27:30 2008
@@ -334,6 +334,12 @@
             case XMLStreamConstants.CHARACTERS:
                 writer.writeCharacters(reader.getText());
                 break;
+            case XMLStreamConstants.COMMENT:
+                writer.writeComment(reader.getText());
+                break;
+            case XMLStreamConstants.CDATA:
+                writer.writeCData(reader.getText());
+                break;
             case XMLStreamConstants.START_DOCUMENT:
             case XMLStreamConstants.END_DOCUMENT:
             case XMLStreamConstants.ATTRIBUTE:

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
Fri Jun 13 14:27:30 2008
@@ -54,6 +54,10 @@
                 
         this.document = element.getOwnerDocument();
     }
+    public W3CDOMStreamReader(Document doc) {
+        super(new ElementFrame(doc));
+        this.document = doc;
+    }
 
     /**
      * Get the document associated with this stream.
@@ -70,7 +74,7 @@
      */
     @Override
     protected final void newFrame(ElementFrame frame) {
-        Element element = getCurrentElement();
+        Node element = getCurrentNode();
         frame.uris = new ArrayList<String>();
         frame.prefixes = new ArrayList<String>();
         frame.attributes = new ArrayList<Object>();
@@ -78,8 +82,9 @@
         if (context == null) {
             context = new W3CNamespaceContext();
         }
-
-        context.setElement(element);
+        if (element instanceof Element) {
+            context.setElement((Element)element);
+        }
 
         NamedNodeMap nodes = element.getAttributes();
 
@@ -122,37 +127,44 @@
         super.endElement();
     }
 
+    public final Node getCurrentNode() {
+        return (Node)getCurrentFrame().element;
+    }
     public final Element getCurrentElement() {
         return (Element)getCurrentFrame().element;
     }
 
     @Override
     protected ElementFrame getChildFrame(int currentChild) {
-        return new ElementFrame(getCurrentElement().getChildNodes().item(currentChild), getCurrentFrame());
+        return new ElementFrame(getCurrentNode().getChildNodes().item(currentChild), getCurrentFrame());
     }
 
     @Override
     protected int getChildCount() {
-        return getCurrentElement().getChildNodes().getLength();
+        return getCurrentNode().getChildNodes().getLength();
     }
 
     @Override
     protected int moveToChild(int currentChild) {
-        this.content = getCurrentElement().getChildNodes().item(currentChild);
-
-        if (content instanceof Text) {
-            return CHARACTERS;
-        } else if (content instanceof Element) {
+        content = getCurrentNode().getFirstChild();
+        while (currentChild > 0 && content != null) {
+            content = content.getNextSibling();
+            --currentChild;
+        }
+        
+        if (content instanceof Element) {
             return START_ELEMENT;
         } else if (content instanceof CDATASection) {
             return CDATA;
         } else if (content instanceof Comment) {
+            return COMMENT;
+        } else if (content instanceof Text) {
             return CHARACTERS;
         } else if (content instanceof EntityReference) {
             return ENTITY_REFERENCE;
         }
 
-        throw new IllegalStateException();
+        throw new IllegalStateException("Found type: " + content.getClass().getName());
     }
 
     @Override
@@ -283,7 +295,10 @@
     }
 
     public String getText() {
-        return DOMUtils.getRawContent(getCurrentElement());
+        if (content instanceof Text) {
+            return ((Text)content).getData();
+        }
+        return DOMUtils.getRawContent(getCurrentNode());
     }
 
     public char[] getTextCharacters() {
@@ -303,7 +318,7 @@
     }
 
     public QName getName() {
-        Element el = getCurrentElement();
+        Node el = getCurrentNode();
 
         String prefix = getPrefix();
         String ln = getLocalName();
@@ -316,17 +331,17 @@
     }
 
     public String getLocalName() {
-        String ln = getCurrentElement().getLocalName();
+        String ln = getCurrentNode().getLocalName();
         if (ln == null) {
-            ln = getCurrentElement().getNodeName();
+            ln = getCurrentNode().getNodeName();
         }
         return ln;
     }
 
     public String getNamespaceURI() {
-        String ln = getCurrentElement().getLocalName();
+        String ln = getCurrentNode().getLocalName();
         if (ln == null) {
-            ln = getCurrentElement().getNodeName();
+            ln = getCurrentNode().getNodeName();
             if (ln.indexOf(":") == -1) {
                 ln = getNamespaceURI("");
             } else {
@@ -334,11 +349,11 @@
             }
             return ln;
         }
-        return getCurrentElement().getNamespaceURI();
+        return getCurrentNode().getNamespaceURI();
     }
 
     public String getPrefix() {
-        String prefix = getCurrentElement().getPrefix();
+        String prefix = getCurrentNode().getPrefix();
         if (prefix == null) {
             prefix = "";
         }

Modified: cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java (original)
+++ cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/StaxUtilsTest.java Fri
Jun 13 14:27:30 2008
@@ -101,8 +101,12 @@
         // seach for the first begin of "<soap:Envelope" to escape the apache licenses
header
         int beginIndex = input.indexOf("<soap:Envelope");
         input = input.substring(beginIndex);
+        beginIndex = output.indexOf("<soap:Envelope");
+        output = output.substring(beginIndex);
+        
         output = output.replaceAll("\r\n", "\n");
         input = input.replaceAll("\r\n", "\n");
+        
         // compare the input and output string
         assertEquals(input, output);
     }

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
Fri Jun 13 14:27:30 2008
@@ -21,8 +21,6 @@
 
 
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
 import java.util.ResourceBundle;
 
 import javax.xml.soap.MessageFactory;
@@ -43,6 +41,7 @@
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.staxutils.W3CDOMStreamReader;
 import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 
 
@@ -55,7 +54,10 @@
  * SOAPMessage.
  */
 public class SAAJOutInterceptor extends AbstractSoapInterceptor {
+
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(SAAJOutInterceptor.class);
+    private static final String ORIGINAL_XML_WRITER 
+        = SAAJOutInterceptor.class.getName() + ".original.xml.writer";
 
     public SAAJOutInterceptor() {
         super(Phase.PRE_PROTOCOL);
@@ -75,10 +77,15 @@
                 SOAPMessage soapMessage = factory.createMessage();
 
                 SOAPPart soapPart = soapMessage.getSOAPPart();
+                
+                XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class);
+                message.put(ORIGINAL_XML_WRITER, origWriter);
                 W3CDOMStreamWriter writer = new W3CDOMStreamWriter(soapPart);
                 // Replace stax writer with DomStreamWriter
                 message.setContent(XMLStreamWriter.class, writer);
                 message.setContent(SOAPMessage.class, soapMessage);
+                
+                
             } catch (SOAPException e) {
                 throw new SoapFault(new Message("SOAPEXCEPTION", BUNDLE), e, version.getSender());
             }
@@ -86,6 +93,9 @@
             //as the SOAPMessage already has everything in place, we do not need XMLStreamWriter
to write
             //anything for us, so we just set XMLStreamWriter's output to a dummy output
stream.         
             try {
+                XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class);
+                message.put(ORIGINAL_XML_WRITER, origWriter);
+                
                 XMLStreamWriter dummyWriter = StaxUtils.getXMLOutputFactory()
                     .createXMLStreamWriter(new ByteArrayOutputStream());
                 message.setContent(XMLStreamWriter.class, dummyWriter);
@@ -97,6 +107,15 @@
         // Add a final interceptor to write the message
         message.getInterceptorChain().add(new SAAJOutEndingInterceptor());
     }
+    @Override
+    public void handleFault(SoapMessage message) {
+        super.handleFault(message);
+        XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER);
+        if (writer != null) {
+            message.setContent(XMLStreamWriter.class, writer);
+        }
+    }
+
     
     public class SAAJOutEndingInterceptor extends AbstractSoapInterceptor {
         public SAAJOutEndingInterceptor() {
@@ -107,23 +126,19 @@
             SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
  
             if (soapMessage != null) {
-                
-                OutputStream os = message.getContent(OutputStream.class);
+                XMLStreamWriter writer = (XMLStreamWriter)message.get(ORIGINAL_XML_WRITER);
                 try {
-                    setMessageContent(message, soapMessage);
-                    soapMessage.writeTo(os);
-                    os.flush();
-                } catch (IOException e) {
-                    throw new SoapFault(new Message("SOAPEXCEPTION", BUNDLE), e, message.getVersion()
-                        .getSender());
-                } catch (SOAPException e) {
+                    StaxUtils.copy(new W3CDOMStreamReader(soapMessage.getSOAPPart()), writer);
+                    writer.flush();
+                    message.setContent(XMLStreamWriter.class, writer);
+                } catch (XMLStreamException e) {
                     throw new SoapFault(new Message("SOAPEXCEPTION", BUNDLE), e, message.getVersion()
-                        .getSender());
+                                        .getSender());
                 }
             }
         }
 
-        private void setMessageContent(SoapMessage message, SOAPMessage soapMessage) 
+        protected void setMessageContent(SoapMessage message, SOAPMessage soapMessage) 
             throws SOAPException {
             
             if (soapMessage.getAttachments().hasNext()) {

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxOutInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxOutInterceptor.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxOutInterceptor.java Fri
Jun 13 14:27:30 2008
@@ -84,8 +84,10 @@
             String a = "application/fastinfoset";
             if (!accepts.isEmpty()) {
                 a += ", " + accepts.get(0);
+                accepts.set(0, a);
+            } else {
+                accepts.add(a);
             }
-            accepts.set(0, a);
         }
             
         if (force 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java Fri
Jun 13 14:27:30 2008
@@ -41,6 +41,7 @@
  * Creates an XMLStreamReader from the InputStream on the Message.
  */
 public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
+    public static final String OUTPUT_STREAM_HOLDER = StaxOutInterceptor.class.getName()
+ ".outputstream";
     public static final String FORCE_START_DOCUMENT = "org.apache.cxf.stax.force-start-document";
     
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(StaxOutInterceptor.class);
@@ -66,6 +67,8 @@
             writer = getXMLOutputFactory(message).createXMLStreamWriter(os, encoding);
             if (Boolean.TRUE.equals(message.getContextualProperty(FORCE_START_DOCUMENT)))
{
                 writer.writeStartDocument(encoding, "1.0");
+                message.removeContent(OutputStream.class);
+                message.put(OUTPUT_STREAM_HOLDER, os);
             }
         } catch (XMLStreamException e) {
             throw new Fault(new org.apache.cxf.common.i18n.Message("STREAM_CREATE_EXC", BUNDLE),
e);
@@ -75,6 +78,14 @@
         // Add a final interceptor to write end elements
         message.getInterceptorChain().add(ending);
     }
+    @Override
+    public void handleFault(Message message) {
+        super.handleFault(message);
+        OutputStream os = (OutputStream)message.get(OUTPUT_STREAM_HOLDER);
+        if (os != null) {
+            message.setContent(OutputStream.class, os);
+        }
+    }
 
     private String getEncoding(Message message) {
         Exchange ex = message.getExchange();
@@ -146,6 +157,10 @@
                     xtw.writeEndDocument();
                     xtw.close();
                 }
+                OutputStream os = (OutputStream)message.get(OUTPUT_STREAM_HOLDER);
+                if (os != null) {
+                    message.setContent(OutputStream.class, os);
+                }
             } catch (XMLStreamException e) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_WRITE_EXC",
BUNDLE), e);
             }

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
Fri Jun 13 14:27:30 2008
@@ -48,7 +48,8 @@
 public class LogicalHandlerOutInterceptor<T extends Message> 
     extends AbstractJAXWSHandlerInterceptor<T> {
     
-    public static final String ORIGINAL_WRITER = "original_writer";
+    public static final String ORIGINAL_WRITER 
+        = LogicalHandlerOutInterceptor.class.getName() + ".original_writer";
     private LogicalHandlerOutEndingInterceptor<T> ending;
     
     public LogicalHandlerOutInterceptor(Binding binding) {
@@ -78,7 +79,14 @@
             throw new Fault(e);
         }
     }
-    
+    @Override
+    public void handleFault(T message) {
+        super.handleFault(message);
+        XMLStreamWriter os = (XMLStreamWriter)message.get(ORIGINAL_WRITER);
+        if (os != null) {
+            message.setContent(XMLStreamWriter.class, os);
+        }
+    }
     
     private class LogicalHandlerOutEndingInterceptor<X extends Message> 
         extends AbstractJAXWSHandlerInterceptor<X> {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Fri Jun 13 14:27:30 2008
@@ -283,8 +283,10 @@
     }
 
     public void handleFault(SoapMessage message) {
-    }
-    
+        if (getInvoker(message).isOutbound()) {
+            SAAJ_OUT.handleFault(message);
+        }
+    }    
     protected QName getOpQName(Exchange ex, Object data) {
         SOAPMessageContextImpl sm = (SOAPMessageContextImpl)data;
         try {

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
Fri Jun 13 14:27:30 2008
@@ -130,7 +130,9 @@
         // This is to set direction to outbound
         expect(exchange.getOutMessage()).andReturn(message).anyTimes();
         CachedStream originalEmptyOs = new CachedStream();
-        message.setContent(OutputStream.class, originalEmptyOs);
+        
+        XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(originalEmptyOs);
+        message.setContent(XMLStreamWriter.class, writer);
 
         InterceptorChain chain = new PhaseInterceptorChain((new PhaseManagerImpl()).getOutPhases());
         //Interceptors after SOAPHandlerInterceptor DOMXMLStreamWriter to write
@@ -154,6 +156,7 @@
             }
 
         });
+        
         chain.add(new SOAPHandlerInterceptor(binding));
         message.setInterceptorChain(chain);
         control.replay();
@@ -162,12 +165,8 @@
         
         control.verify();
 
-        // Verify outputStream
-        CachedStream expectedOs = prepareOutputStreamFromResource("resources/greetMeRpcLitRespChanged.xml");
-
-        assertTrue("The content of outputStream should remain unchanged", compareInputStream(expectedOs
-            .getInputStream(), originalEmptyOs.getInputStream()));
-
+        writer.flush();
+        
         // Verify SOAPMessage
         SOAPMessage resultedMessage = message.getContent(SOAPMessage.class);
         assertNotNull(resultedMessage);
@@ -469,18 +468,6 @@
         assertTrue(understood.isEmpty());
     }
 
-    private boolean compareInputStream(InputStream os1, InputStream os2) throws Exception
{
-        if (os1.available() != os2.available()) {
-            return false;
-        }
-        for (int i = 0; i < os1.available(); i++) {
-            if (os1.read() != os2.read()) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     private XMLStreamReader preparemXMLStreamReader(String resouceName) throws Exception
{
         InputStream is = this.getClass().getResourceAsStream(resouceName);
         XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(is);
@@ -546,18 +533,6 @@
         return soapMessage;
     }
 
-    private CachedStream prepareOutputStreamFromResource(String resouceName) throws Exception
{
-        SOAPMessage soapMessage = prepareSOAPMessage(resouceName);
-        CachedStream os = new CachedStream();
-        soapMessage.writeTo(os);
-        return os;
-    }
-/*
-    private CachedStream prepareOutputStreamFromSOAPMessage(SOAPMessage soapMessage) throws
Exception {
-        CachedStream os = new CachedStream();
-        soapMessage.writeTo(os);
-        return os;
-    }*/
 
     private class CachedStream extends CachedOutputStream {
         protected void doFlush() throws IOException {

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
Fri Jun 13 14:27:30 2008
@@ -78,6 +78,9 @@
         
         mc.getInterceptorChain().add(ending);
     }    
+    public void handleFault(SoapMessage message) {
+        saajOut.handleFault(message);
+    } 
     
     public final WSS4JOutInterceptorInternal createEndingInterceptor() {
         return new WSS4JOutInterceptorInternal();

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java?rev=667660&r1=667659&r2=667660&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
Fri Jun 13 14:27:30 2008
@@ -76,7 +76,7 @@
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        assertTrue("server did not launch correctly", launchServer(Server.class, true));
     }
 
     @Before



Mime
View raw message