cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r643551 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/ rt/frontend/jaxws/src...
Date Tue, 01 Apr 2008 20:13:51 GMT
Author: dkulp
Date: Tue Apr  1 13:13:43 2008
New Revision: 643551

URL: http://svn.apache.org/viewvc?rev=643551&view=rev
Log:
Merged revisions 643546 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r643546 | dkulp | 2008-04-01 16:00:43 -0400 (Tue, 01 Apr 2008) | 2 lines
  
  [CXF-1491] More fixes related to pulling the fault checking stuff out of the ReadHeadersInterceptor
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
    incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainInvoker.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
    incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java?rev=643551&r1=643550&r2=643551&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/W3CDOMStreamReader.java
Tue Apr  1 13:13:43 2008
@@ -50,9 +50,8 @@
     public W3CDOMStreamReader(Element element) {
         super(new ElementFrame(element, null));
         newFrame(getCurrentFrame());
-
+                
         this.document = element.getOwnerDocument();
-        
     }
 
     /**
@@ -178,6 +177,9 @@
                 return frame.uris.get(index);
             }
 
+            if (frame.parent == null) {
+                return ((Element)frame.getElement()).lookupNamespaceURI(prefix);
+            }
             frame = frame.parent;
         }
 

Modified: incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java?rev=643551&r1=643550&r2=643551&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
Tue Apr  1 13:13:43 2008
@@ -84,6 +84,9 @@
         FaultInfo faultWanted = null;
         MessagePartInfo part = null;
         BindingOperationInfo boi = msg.getExchange().get(BindingOperationInfo.class);
+        if (boi == null) {
+            return;
+        }
         if (boi.isUnwrapped()) {
             boi = boi.getWrappedOperation();
         }

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainInvoker.java?rev=643551&r1=643550&r2=643551&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainInvoker.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainInvoker.java
Tue Apr  1 13:13:43 2008
@@ -371,7 +371,7 @@
                 }
                 continueProcessing = false;
                 setFault(e);
-                if (responseExpected) {
+                if (responseExpected || isInbound()) {
                     //brain dead spec - if it's one way, swallow it
                     if (e instanceof SOAPFaultException) {
                         throw mapSoapFault((SOAPFaultException)e);

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?rev=643551&r1=643550&r2=643551&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Tue Apr  1 13:13:43 2008
@@ -108,7 +108,7 @@
 
             message.getInterceptorChain().add(ending);
         } else {
-            handleMessageInternal(message);
+            boolean isFault = handleMessageInternal(message);
             SOAPMessage msg = message.getContent(SOAPMessage.class);
             if (msg != null) {
                 XMLStreamReader xmlReader = createXMLStreamReaderFromSOAPMessage(msg);
@@ -120,12 +120,24 @@
                     e.printStackTrace();
                 }
             }
+            if (isFault) {
+                Endpoint ep = message.getExchange().get(Endpoint.class);
+                message.getInterceptorChain().abort();
+                if (ep.getInFaultObserver() != null) {
+                    ep.getInFaultObserver().onMessage(message);
+                    
+                }
+            }
         }
     }
 
-    private void handleMessageInternal(SoapMessage message) {
+    private boolean handleMessageInternal(SoapMessage message) {
         
         MessageContext context = createProtocolMessageContext(message);
+        if (context == null) {
+            return true;
+        }
+                
         HandlerChainInvoker invoker = getInvoker(message);
         invoker.setProtocolMessageContext(context);
 
@@ -140,6 +152,7 @@
         } else if (isOutbound(message) && isMEPComlete(message)) {
             onCompletion(message);
         }
+        return false;
     }
 
     private void handleAbort(SoapMessage message, MessageContext context) {
@@ -208,10 +221,21 @@
     @Override
     protected MessageContext createProtocolMessageContext(SoapMessage message) {
         SOAPMessageContextImpl sm = new SOAPMessageContextImpl(message);
+        
         boolean requestor = isRequestor(message);
         ContextPropertiesMapping.mapCxf2Jaxws(message.getExchange(), sm, requestor);
         Exchange exch = message.getExchange();
         setupBindingOperationInfo(exch, sm);
+        try {            
+            SOAPMessage msg = sm.getMessage();
+            if (msg.getSOAPPart().getEnvelope().getBody() != null 
+                && msg.getSOAPPart().getEnvelope().getBody().hasFault()) {
+                return null;
+            }            
+        } catch (SOAPException e) {
+            throw new Fault(e);
+        }
+        
         return sm;
     }
 

Modified: incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java?rev=643551&r1=643550&r2=643551&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
Tue Apr  1 13:13:43 2008
@@ -35,7 +35,6 @@
 import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPConstants;
 import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.transform.Source;
@@ -92,6 +91,7 @@
 
     public void handleMessage(Message message) throws Fault {
         Exchange ex = message.getExchange();     
+
         Endpoint ep = ex.get(Endpoint.class);
         MessageInfo info = message.get(MessageInfo.class);
         if (ep.getEndpointInfo().getBinding().getOperations().iterator().hasNext()) {
@@ -122,21 +122,18 @@
             
             if (message instanceof SoapMessage) {
                 SOAPMessage soapMessage = newSOAPMessage(is, (SoapMessage)message);
-                SOAPFault soapFault = soapMessage.getSOAPBody().getFault();
-                if (soapFault != null) {
+                if (soapMessage.getSOAPBody().hasFault()) {
                     message.getInterceptorChain().abort();
                     if (ep.getInFaultObserver() != null) {
-                        message.setContent(SOAPMessage.class, soapMessage); 
+                        message.setContent(SOAPMessage.class, soapMessage);
+                        XMLStreamReader reader = StaxUtils
+                            .createXMLStreamReader(soapMessage.getSOAPBody().getFault());
+                        reader.nextTag();
+                        message.setContent(XMLStreamReader.class, reader);
+                        
                         ep.getInFaultObserver().onMessage(message);
                         return;
                     }
-
-                    /*
-                    Fault fault = new Fault(new org.apache.cxf.common.i18n.Message(soapFault.getFaultString(),
-                                                                                   LOG));
-                    fault.setFaultCode(soapFault.getFaultCodeAsQName());
-                    message.setContent(Exception.class, fault);
-                    */
                 }                
                 
                 PostDispatchSOAPHandlerInterceptor postSoap = new PostDispatchSOAPHandlerInterceptor();



Mime
View raw message