You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by tl...@apache.org on 2006/08/28 12:31:45 UTC

svn commit: r437629 - /incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/MustUnderstandInterceptor.java

Author: tli
Date: Mon Aug 28 03:31:41 2006
New Revision: 437629

URL: http://svn.apache.org/viewvc?rev=437629&view=rev
Log:
Restore the check header binding params for MustUnderstandInterceptor

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

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/MustUnderstandInterceptor.java?rev=437629&r1=437628&r2=437629&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/MustUnderstandInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/MustUnderstandInterceptor.java Mon Aug 28 03:31:41 2006
@@ -19,6 +19,7 @@
 
 public class MustUnderstandInterceptor extends AbstractSoapInterceptor {
     private static final Logger LOG = LogUtils.getL7dLogger(MustUnderstandInterceptor.class);
+
     private static final ResourceBundle BUNDLE = LOG.getResourceBundle();
 
     public MustUnderstandInterceptor() {
@@ -43,21 +44,20 @@
             }
             sb.delete(pos - 2, pos);
             throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, sb.toString()),
-                                SoapFault.MUST_UNDERSTAND);
+                            SoapFault.MUST_UNDERSTAND);
         }
     }
 
     private void initServiceSideInfo(Set<QName> mustUnderstandQNames, SoapMessage soapMessage,
-                                     Set<URI> serviceRoles) {
-        // 
-        // Set<QName> paramHeaders =
-        // HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
-        // if (paramHeaders != null) {
-        // mustUnderstandQNames.addAll(paramHeaders);
-        // }
+                    Set<URI> serviceRoles) {
+
+        Set<QName> paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
+        if (paramHeaders != null) {
+            mustUnderstandQNames.addAll(paramHeaders);
+        }
         for (Interceptor interceptorInstance : soapMessage.getInterceptorChain()) {
             if (interceptorInstance instanceof SoapInterceptor) {
-                SoapInterceptor si = (SoapInterceptor)interceptorInstance;
+                SoapInterceptor si = (SoapInterceptor) interceptorInstance;
                 serviceRoles.addAll(si.getRoles());
                 mustUnderstandQNames.addAll(si.getUnderstoodHeaders());
             }
@@ -65,27 +65,26 @@
     }
 
     private void buildMustUnderstandHeaders(Set<Element> mustUnderstandHeaders, SoapMessage soapMessage,
-                                            Set<URI> serviceRoles) {
-        Element headers = (Element)soapMessage.getHeaders(Element.class);
+                    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));
+                headerChilds.add((Element) headers.getChildNodes().item(i));
             }
         }
         for (int i = 0; i < headerChilds.size(); i++) {
             Element header = headerChilds.get(i);
             String mustUnderstand = header.getAttributeNS(soapMessage.getVersion().getNamespace(),
-                                                          soapMessage.getVersion()
-                                                              .getAttrNameMustUnderstand());
+                            soapMessage.getVersion().getAttrNameMustUnderstand());
 
             if (Boolean.valueOf(mustUnderstand) || "1".equals(mustUnderstand.trim())) {
                 String role = header.getAttributeNS(soapMessage.getVersion().getNamespace(), soapMessage
-                    .getVersion().getAttrNameRole());
+                                .getVersion().getAttrNameRole());
                 if (role != null) {
                     role = role.trim();
                     if (role.equals(soapMessage.getVersion().getNextRole())
-                        || role.equals(soapMessage.getVersion().getUltimateReceiverRole())) {
+                                    || role.equals(soapMessage.getVersion().getUltimateReceiverRole())) {
                         mustUnderstandHeaders.add(header);
                     } else {
                         for (URI roleFromBinding : serviceRoles) {
@@ -105,7 +104,7 @@
     }
 
     private boolean checkUnderstand(Set<Element> mustUnderstandHeaders, Set<QName> mustUnderstandQNames,
-                                    Set<QName> notUnderstandQNames) {
+                    Set<QName> notUnderstandQNames) {
 
         for (Element header : mustUnderstandHeaders) {
             QName qname = new QName(header.getNamespaceURI(), header.getLocalName());