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 gd...@apache.org on 2002/01/18 18:45:26 UTC

cvs commit: xml-axis/java/src/org/apache/axis/message SOAPEnvelope.java RPCElement.java

gdaniels    02/01/18 09:45:26

  Modified:    java/src/org/apache/axis/message SOAPEnvelope.java
                        RPCElement.java
  Log:
  Clean up default namespace handing - use encodingStyle from envelope
  where appropriate.
  
  Revision  Changes    Path
  1.53      +5 -1      xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
  
  Index: SOAPEnvelope.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- SOAPEnvelope.java	16 Jan 2002 19:14:02 -0000	1.52
  +++ SOAPEnvelope.java	18 Jan 2002 17:45:26 -0000	1.53
  @@ -148,7 +148,11 @@
                        Constants.ATTR_ENCODING_STYLE,
                        encodingStyleURI);
       }
  -    
  +
  +    public String getEncodingStyleURI() {
  +        return encodingStyleURI;
  +    }
  +
       public Vector getBodyElements() throws AxisFault
       {
           return bodyElements;
  
  
  
  1.29      +24 -7     xml-axis/java/src/org/apache/axis/message/RPCElement.java
  
  Index: RPCElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCElement.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- RPCElement.java	16 Jan 2002 19:14:02 -0000	1.28
  +++ RPCElement.java	18 Jan 2002 17:45:26 -0000	1.29
  @@ -155,25 +155,42 @@
           this.encodingStyle = encodingStyle;
       }
   
  +    public String getEncodingStyle() {
  +        if (encodingStyle == null) {
  +            return getEnvelope().getEncodingStyleURI();
  +        }
  +
  +        return encodingStyle;
  +    }
  +
       protected void outputImpl(SerializationContext context) throws Exception
       {
  +/*
           if (encodingStyle != null) {
  -            QName qn = new QName(Constants.URI_SOAP_ENC, 
  +            QName qn = new QName(Constants.URI_SOAP_ENC,
                                    Constants.ATTR_ENCODING_STYLE);
  -            
  +
               if (attributes == null)
                   attributes = new AttributesImpl();
  -            
  -            attributes.addAttribute(Constants.URI_SOAP_ENC, 
  +
  +            attributes.addAttribute(Constants.URI_SOAP_ENC,
                                       Constants.ATTR_ENCODING_STYLE,
                                       context.qName2String(qn),
                                       "CDATA",
                                       encodingStyle);
           }
  -        
  +*/
  +        if (encodingStyle != null) {
  +            setAttribute(Constants.URI_SOAP_ENC,
  +                         Constants.ATTR_ENCODING_STYLE,
  +                         encodingStyle);
  +        }
  +
           // Set default namespace if appropriate (to avoid prefix mappings
  -        // in literal style)
  -        if (encodingStyle == null || encodingStyle.equals("")) {
  +        // in literal style).  Do this only if there is no encodingStyle
  +        // on EITHER the RPCElement or its parent envelope.
  +        String realEncStyle = getEncodingStyle();
  +        if (realEncStyle == null || realEncStyle.equals("")) {
               context.registerPrefixForURI("", getNamespaceURI());
           }