You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by du...@locus.apache.org on 2000/07/28 01:11:50 UTC

cvs commit: xml-soap/java/src/org/apache/soap Fault.java

duftler     00/07/27 16:11:50

  Modified:    java/src/org/apache/soap Fault.java
  Log:
  The unmarshalling logic in Fault will now accept the SOAP-ENV namespace
  uri in addition to the old accepted behavior of no namespace uri at all,
  when processing subelements of Fault.
  Submitted by: Steven McDowall sjm@aptest.com
  
  Revision  Changes    Path
  1.3       +30 -16    xml-soap/java/src/org/apache/soap/Fault.java
  
  Index: Fault.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Fault.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Fault.java	2000/05/30 10:23:50	1.2
  +++ Fault.java	2000/07/27 23:11:50	1.3
  @@ -252,25 +252,39 @@
         // Examine the subelements of the fault.
         while (tempEl != null)
         {
  -        if (tempEl != null
  -            && tempEl.getTagName().equals(Constants.ELEM_FAULT_CODE))
  +        String namespaceURI = tempEl.getNamespaceURI();
  +        String localPart    = tempEl.getLocalName();
  +
  +        if (localPart == null)
           {
  -          faultCodeEl = tempEl;
  +          localPart = tempEl.getTagName();
           }
  -        else if (tempEl != null
  -                 && tempEl.getTagName().equals(Constants.ELEM_FAULT_STRING))
  +
  +        // SOAP-ENV namespace is ok, as is no namespace at all.
  +        if (namespaceURI == null
  +            || namespaceURI.equals(Constants.NS_URI_SOAP_ENV))
           {
  -          faultStringEl = tempEl;
  -        }
  -        else if (tempEl != null
  -                 && tempEl.getTagName().equals(Constants.ELEM_FAULT_ACTOR))
  -        {
  -          faultActorEl = tempEl;
  -        }
  -        else if (tempEl != null
  -                 && tempEl.getTagName().equals(Constants.ELEM_DETAIL))
  -        {
  -          detailEl = tempEl;
  +          if (localPart.equals(Constants.ELEM_FAULT_CODE))
  +          {
  +            faultCodeEl = tempEl;
  +          }
  +          else if (localPart.equals(Constants.ELEM_FAULT_STRING))
  +          {
  +            faultStringEl = tempEl;
  +          }
  +          else if (localPart.equals(Constants.ELEM_FAULT_ACTOR))
  +          {
  +            faultActorEl = tempEl;
  +          }
  +          else if (localPart.equals(Constants.ELEM_DETAIL))
  +          {
  +            detailEl = tempEl;
  +          }
  +          else
  +          {
  +            // This must be an additional fault entry.
  +            faultEntries.addElement(tempEl);
  +          }
           }
           else
           {