cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r438458 - in /incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap: SoapBindingFactory.java interceptor/AbstractSoapInterceptor.java interceptor/MustUnderstandInterceptor.java interceptor/SoapOutInterceptor.java
Date Wed, 30 Aug 2006 10:58:14 GMT
Author: tli
Date: Wed Aug 30 03:58:13 2006
New Revision: 438458

URL: http://svn.apache.org/viewvc?rev=438458&view=rev
Log:
fix the wrong face of MustUnderstandInterceptor, add attachment into soap binding interceptors

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=438458&r1=438457&r2=438458&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Wed Aug 30 03:58:13 2006
@@ -39,6 +39,7 @@
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.BindingFactoryManager;
+import org.apache.cxf.binding.soap.interceptor.AttachmentOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.MultipartMessageInterceptor;
 import org.apache.cxf.binding.soap.interceptor.MustUnderstandInterceptor;
 import org.apache.cxf.binding.soap.interceptor.RPCInInterceptor;
@@ -102,6 +103,7 @@
         sb.getOutInterceptors().add(new StaxOutInterceptor());
         sb.getOutInterceptors().add(new SoapOutInterceptor());
 
+        sb.getOutFaultInterceptors().add(new AttachmentOutInterceptor());
         sb.getOutFaultInterceptors().add(new StaxOutInterceptor());
         sb.getOutFaultInterceptors().add(new SoapOutInterceptor());
         sb.getOutFaultInterceptors().add(sb.getOutFaultInterceptor());

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java?rev=438458&r1=438457&r2=438458&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/AbstractSoapInterceptor.java
Wed Aug 30 03:58:13 2006
@@ -31,6 +31,11 @@
 public abstract class AbstractSoapInterceptor extends AbstractPhaseInterceptor<SoapMessage>

     implements SoapInterceptor {
 
+    protected boolean isRequestor(org.apache.cxf.message.Message message) {
+        return Boolean.TRUE.equals(message.containsKey(
+            org.apache.cxf.message.Message.REQUESTOR_ROLE));
+    }  
+    
     public Set<URI> getRoles() {
         return Collections.emptySet();
     }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?rev=438458&r1=438457&r2=438458&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
Wed Aug 30 03:58:13 2006
@@ -46,10 +46,14 @@
 
     public MustUnderstandInterceptor() {
         super();
-        setPhase(Phase.PROTOCOL);
+        setPhase(Phase.PRE_PROTOCOL);
     }
 
     public void handleMessage(SoapMessage soapMessage) {
+        //Client-in message needs not to handle MustUnderstand
+        if (isRequestor(soapMessage)) {
+            return;
+        }                
         Set<Element> mustUnderstandHeaders = new HashSet<Element>();
         Set<URI> serviceRoles = new HashSet<URI>();
         Set<QName> notUnderstandQNames = new HashSet<QName>();
@@ -90,10 +94,12 @@
                     Set<URI> serviceRoles) {
         Element headers = (Element) soapMessage.getHeaders(Element.class);
         List<Element> headerChilds = new ArrayList<Element>();
-        for (int i = 0; i < headers.getChildNodes().getLength(); i++) {
-            if (headers.getChildNodes().item(i) instanceof Element) {
-                headerChilds.add((Element) headers.getChildNodes().item(i));
-            }
+        if (headers != null) {
+            for (int i = 0; i < headers.getChildNodes().getLength(); i++) {
+                if (headers.getChildNodes().item(i) instanceof Element) {
+                    headerChilds.add((Element) headers.getChildNodes().item(i));
+                }
+            }            
         }
         for (int i = 0; i < headerChilds.size(); i++) {
             Element header = headerChilds.get(i);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?rev=438458&r1=438457&r2=438458&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Wed Aug 30 03:58:13 2006
@@ -93,11 +93,6 @@
     
     private void handleHeaderPart(SoapMessage message) {
         //add MessagePart to soapHeader if necessary
-    }
-        
-    protected boolean isRequestor(org.apache.cxf.message.Message message) {
-        return Boolean.TRUE.equals(message.containsKey(
-            org.apache.cxf.message.Message.REQUESTOR_ROLE));
-    }    
+    }       
     
 }



Mime
View raw message