You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2001/07/12 18:48:05 UTC

cvs commit: xml-axis/java/src/org/apache/axis/message MessageElement.java SOAPSAXHandler.java

rubys       01/07/12 09:48:04

  Modified:    java/src/org/apache/axis/message MessageElement.java
                        SOAPSAXHandler.java
  Log:
  Default Root to true, and use it to determine the type of element
  
  Revision  Changes    Path
  1.31      +1 -2      xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- MessageElement.java	2001/07/12 15:04:06	1.30
  +++ MessageElement.java	2001/07/12 16:47:56	1.31
  @@ -80,7 +80,7 @@
       protected AttributesImpl attributes;
       protected String    id;
       protected String    href;
  -    protected boolean   isRoot = false;
  +    protected boolean   isRoot = true;
       protected SOAPEnvelope message = null;
       
       // The java Object value of this element.  This is either set by
  @@ -128,7 +128,6 @@
   
           this.attributes = new AttributesImpl(attributes);
           String rootVal = attributes.getValue(Constants.URI_SOAP_ENV, Constants.ATTR_ROOT);
  -        // !!! This currently defaults to false... should it default to true?
           if (rootVal != null)
               isRoot = rootVal.equals("1");
         
  
  
  
  1.22      +7 -6      xml-axis/java/src/org/apache/axis/message/SOAPSAXHandler.java
  
  Index: SOAPSAXHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPSAXHandler.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SOAPSAXHandler.java	2001/07/11 20:02:17	1.21
  +++ SOAPSAXHandler.java	2001/07/12 16:47:58	1.22
  @@ -139,14 +139,15 @@
                * to know at this point if this is an RPC service or not.  It's
                * possible that no one has set the service up until this point,
                * so if that's the case we should attempt to set it based on the
  -             * namespace of the first body element without an ID (assuming
  -             * that ID'ed attributes are multi-ref encodings).  Setting the
  +             * namespace of the first root body element.  Setting the
                * service may (should?) result in setting the service
                * description, which can then tell us what to create.
                */
  -            String id = attributes.getValue("id");
  +            boolean isRoot = true;
  +            String id = attributes.getValue(Constants.ATTR_ROOT);
  +            if ((id != null) && id.equals("0")) isRoot = false;
   
  -            if (id == null &&
  +            if (isRoot &&
                   context.getMessageContext().getServiceHandler() == null) {
                   Debug.Print(2, "Dispatching to body namespace '",
                               namespace, "'");
  @@ -154,13 +155,13 @@
               }
               
               /** Now we make a plain SOAPBodyElement IF we either:
  -             * a) have an ID attribute, or
  +             * a) have an non-root element, or
                * b) have a non-RPC service
                */
               ServiceDescription serviceDesc = context.getServiceDescription();
               if (((serviceDesc != null) &&
                   (!serviceDesc.isRPC())) ||
  -                (id != null)) {
  +                (!isRoot)) {
                   return new SOAPBodyElement(namespace, localName, attributes, context);
               }