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 2003/01/06 19:30:08 UTC

cvs commit: xml-axis/java/src/org/apache/axis/client Call.java

gdaniels    2003/01/06 10:30:08

  Modified:    java/src/org/apache/axis/message SOAPEnvelope.java
               java/src/org/apache/axis/schema SchemaVersion.java
               java/src/org/apache/axis/providers/java JavaProvider.java
               java/src/org/apache/axis/client Call.java
  Log:
  Start working on bug 15581:
  
  * Add SOAPEnvelope field to keep track of current schema version,
    and set namespaces based on that.  Add appropriate constructors.
  
  * Pass schemaVersion when building envelopes.
  
  Revision  Changes    Path
  1.84      +27 -3     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.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- SOAPEnvelope.java	11 Dec 2002 22:38:20 -0000	1.83
  +++ SOAPEnvelope.java	6 Jan 2003 18:30:07 -0000	1.84
  @@ -58,6 +58,7 @@
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.schema.SchemaVersion;
   import org.apache.axis.client.AxisClient;
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.configuration.NullProvider;
  @@ -91,6 +92,7 @@
   
       public Vector trailers = new Vector();
       private SOAPConstants soapConstants;
  +    private SchemaVersion schemaVersion = SchemaVersion.SCHEMA_2001;
   
       // This is a hint to any service description to tell it what
       // "type" of message we are.  This might be "request", "response",
  @@ -110,9 +112,23 @@
           this(true, soapConstants);
       }
   
  +    public SOAPEnvelope(SOAPConstants soapConstants,
  +                        SchemaVersion schemaVersion)
  +    {
  +        this(true, soapConstants, schemaVersion);
  +    }
  +
       public SOAPEnvelope(boolean registerPrefixes, SOAPConstants soapConstants)
       {
  +        this (registerPrefixes, soapConstants, SchemaVersion.SCHEMA_2001);
  +    }
  +    
  +    public SOAPEnvelope(boolean registerPrefixes,
  +                        SOAPConstants soapConstants,
  +                        SchemaVersion schemaVersion)
  +    {    
           this.soapConstants = soapConstants;
  +        this.schemaVersion = schemaVersion;
           header = new SOAPHeader(this, soapConstants);
           body = new SOAPBody(this, soapConstants);
   
  @@ -122,15 +138,15 @@
   
               namespaces.add(new Mapping(soapConstants.getEnvelopeURI(),
                                          Constants.NS_PREFIX_SOAP_ENV));
  -            namespaces.add(new Mapping(Constants.URI_DEFAULT_SCHEMA_XSD,
  +            namespaces.add(new Mapping(schemaVersion.getXsdURI(),
                                          Constants.NS_PREFIX_SCHEMA_XSD));
  -            namespaces.add(new Mapping(Constants.URI_DEFAULT_SCHEMA_XSI,
  +            namespaces.add(new Mapping(schemaVersion.getXsiURI(),
                                          Constants.NS_PREFIX_SCHEMA_XSI));
           }
   
           setDirty(true);
       }
  -
  +    
       public SOAPEnvelope(InputStream input) throws SAXException {
           InputSource is = new InputSource(input);
           header = new SOAPHeader(this, soapConstants); // soapConstants = null!
  @@ -417,6 +433,14 @@
   
       public void setSoapConstants(SOAPConstants soapConstants) {
           this.soapConstants = soapConstants;
  +    }
  +
  +    public SchemaVersion getSchemaVersion() {
  +        return schemaVersion;
  +    }
  +
  +    public void setSchemaVersion(SchemaVersion schemaVersion) {
  +        this.schemaVersion = schemaVersion;
       }
   
       // JAXM methods
  
  
  
  1.4       +2 -1      xml-axis/java/src/org/apache/axis/schema/SchemaVersion.java
  
  Index: SchemaVersion.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/schema/SchemaVersion.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SchemaVersion.java	4 Sep 2002 14:14:28 -0000	1.3
  +++ SchemaVersion.java	6 Jan 2003 18:30:07 -0000	1.4
  @@ -58,6 +58,7 @@
   import org.apache.axis.encoding.TypeMapping;
   
   import javax.xml.namespace.QName;
  +import java.io.Serializable;
   
   /**
    * The SchemaVersion interface allows us to abstract out the differences
  @@ -65,7 +66,7 @@
    *
    * @author Glen Daniels (gdaniels@apache.org)
    */
  -public interface SchemaVersion {
  +public interface SchemaVersion extends Serializable {
       public static SchemaVersion SCHEMA_1999 = new SchemaVersion1999();
       public static SchemaVersion SCHEMA_2000 = new SchemaVersion2000();
       public static SchemaVersion SCHEMA_2001 = new SchemaVersion2001();
  
  
  
  1.96      +3 -1      xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- JavaProvider.java	17 Dec 2002 20:45:18 -0000	1.95
  +++ JavaProvider.java	6 Jan 2003 18:30:07 -0000	1.96
  @@ -311,8 +311,10 @@
               SOAPEnvelope   resEnv;
   
               // If we didn't have a response message, make sure we set one up
  +            // with the appropriate versions of SOAP and Schema
               if (resMsg == null) {
  -                resEnv  = new SOAPEnvelope(msgContext.getSOAPConstants());
  +                resEnv  = new SOAPEnvelope(msgContext.getSOAPConstants(),
  +                                           msgContext.getSchemaVersion());
   
                   resMsg = new Message(resEnv);
                   msgContext.setResponseMessage( resMsg );
  
  
  
  1.198     +4 -2      xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.197
  retrieving revision 1.198
  diff -u -r1.197 -r1.198
  --- Call.java	2 Jan 2003 19:26:13 -0000	1.197
  +++ Call.java	6 Jan 2003 18:30:07 -0000	1.198
  @@ -1567,7 +1567,8 @@
               /* ok, we're doing Messaging, so build up the message */
               /******************************************************/
               isMsg = true ;
  -            env = new SOAPEnvelope(msgContext.getSOAPConstants());
  +            env = new SOAPEnvelope(msgContext.getSOAPConstants(),
  +                                   msgContext.getSchemaVersion());
   
               if ( !(params[0] instanceof SOAPEnvelope) )
                   for ( i = 0 ; i < params.length ; i++ )
  @@ -2128,7 +2129,8 @@
           }
   
           SOAPEnvelope         reqEnv =
  -                new SOAPEnvelope(msgContext.getSOAPConstants());
  +                new SOAPEnvelope(msgContext.getSOAPConstants(),
  +                                 msgContext.getSchemaVersion());
           SOAPEnvelope         resEnv = null ;
           Message              reqMsg = new Message( reqEnv );
           Message              resMsg = null ;