axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14340] New: - mustunderstand values patch for soap 1.2
Date Thu, 07 Nov 2002 11:34:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14340>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14340

mustunderstand values patch for soap 1.2

           Summary: mustunderstand values patch for soap 1.2
           Product: Axis
           Version: future (enh)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: andras.avar@nokia.com


Hi,

Since the mustunderstand attribute values are changed in soap 1.2 here is a
patch for it. Plz let me know if this helps.

Br,
Andras



And of course the diff:
--- 20021027/org/apache/axis/message/SOAPHeaderElement.java	Wed Oct 16 10:38:10 2002
+++ 1_0_soap12/org/apache/axis/message/SOAPHeaderElement.java	Wed Nov  6
15:40:48 2002
@@ -67,7 +67,7 @@
 import javax.xml.soap.Name;
 import javax.xml.namespace.QName;
 
-/** 
+/**
  * A simple header element abstraction.  Extends MessageElement with
  * header-specific stuff like mustUnderstand, actor, and a 'processed' flag.
  *
@@ -100,13 +100,18 @@
     {
         super(elem);
 
-        // FIXME : This needs to come from someplace reasonable, perhaps
-        // TLS (SOAPConstants.getCurrentVersion() ?)
         SOAPConstants soapConstants = SOAPConstants.SOAP11_CONSTANTS;
 
+        if
(getNamespaceURI().equals(SOAPConstants.SOAP12_CONSTANTS.getEnvelopeURI()))
+            soapConstants = SOAPConstants.SOAP12_CONSTANTS;
+
         String val = elem.getAttributeNS(soapConstants.getEnvelopeURI(),
                                          Constants.ATTR_MUST_UNDERSTAND);
-        mustUnderstand = ((val != null) && val.equals("1")) ? true : false;
+
+        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
+            mustUnderstand = ((val != null) && val.equals("true")) ? true : false;
+        else
+            mustUnderstand = ((val != null) && val.equals("1")) ? true : false;
 
         QName roleQName = soapConstants.getRoleAttributeQName();
         actor = elem.getAttributeNS(roleQName.getNamespaceURI(),
@@ -118,9 +123,9 @@
 
     public void setParentElement(SOAPElement parent) throws SOAPException {
         if(parent == null)
-            throw new
IllegalArgumentException(Messages.getMessage("nullParent00")); 
+            throw new
IllegalArgumentException(Messages.getMessage("nullParent00"));
         if(!(parent instanceof SOAPHeader))
-            throw new
IllegalArgumentException(Messages.getMessage("illegalArgumentException00")); 
+            throw new
IllegalArgumentException(Messages.getMessage("illegalArgumentException00"));
         try {
             super.setParentElement((SOAPHeader)parent);
         } catch (Throwable t) {
@@ -144,7 +149,11 @@
         // Check for mustUnderstand
         String val = attributes.getValue(soapConstants.getEnvelopeURI(),
                                          Constants.ATTR_MUST_UNDERSTAND);
-        mustUnderstand = ((val != null) && val.equals("1")) ? true : false;
+
+        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS)
+            mustUnderstand = ((val != null) && val.equals("true")) ? true : false;
+        else
+            mustUnderstand = ((val != null) && val.equals("1")) ? true : false;
 
         QName roleQName = soapConstants.getRoleAttributeQName();
         actor = attributes.getValue(roleQName.getNamespaceURI(),
@@ -187,7 +196,11 @@
             setAttribute(roleQName.getNamespaceURI(),
                          roleQName.getLocalPart(), actor);
 
-            String val = mustUnderstand ? "1" : "0";
+            String val;
+            if (context.getMessageContext().getSOAPConstants() ==
SOAPConstants.SOAP12_CONSTANTS)
+                val = mustUnderstand ? "true" : "false";
+            else
+                val = mustUnderstand ? "1" : "0";
 
             setAttribute(soapVer.getEnvelopeURI(),
                          Constants.ATTR_MUST_UNDERSTAND,

Mime
View raw message