axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/client Call.java
Date Wed, 10 Jul 2002 03:37:00 GMT
gdaniels    2002/07/09 20:37:00

  Modified:    java/src/org/apache/axis/encoding
                        SerializationContextImpl.java
               java/src/org/apache/axis MessageContext.java AxisEngine.java
               java/src/org/apache/axis/client Call.java
  Log:
  Allow for selecting the default SOAP version in the engine's global
  configuration.  If you set the "defaultSOAPVersion" parameter to "1.2",
  you'll do SOAP 1.2 by default.
  
  Revision  Changes    Path
  1.43      +3 -1      xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
  
  Index: SerializationContextImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- SerializationContextImpl.java	10 Jul 2002 00:06:56 -0000	1.42
  +++ SerializationContextImpl.java	10 Jul 2002 03:36:59 -0000	1.43
  @@ -211,6 +211,8 @@
   
           Handler optionSource = null ;
           if ( msgContext != null ) {
  +            soapConstants = msgContext.getSOAPConstants();
  +
               // optionSource = msgContext.getService();
               if (optionSource == null)
                   optionSource = msgContext.getAxisEngine();
  @@ -1128,7 +1130,7 @@
                   info = getSerializer(javaType, value);
                   // Must send type if it does not match preferred type
                   if (xmlType != null) {
  -                    sendType = true;  
  +                    sendType = true;
                   }
                   xmlType = null;
               }
  
  
  
  1.111     +16 -9     xml-axis/java/src/org/apache/axis/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- MessageContext.java	3 Jul 2002 17:50:30 -0000	1.110
  +++ MessageContext.java	10 Jul 2002 03:36:59 -0000	1.111
  @@ -195,12 +195,12 @@
       private SchemaVersion schemaVersion = SchemaVersion.SCHEMA_2001;
   
       private OperationDesc currentOperation = null;
  -    
  +
       public  OperationDesc getOperation()
       {
           return currentOperation;
       }
  -    
  +
       public void setOperation(OperationDesc operation)
       {
           currentOperation = operation;
  @@ -232,7 +232,7 @@
   
           if (serviceHandler != null) {
               ServiceDesc desc = serviceHandler.getInitializedServiceDesc(this);
  -    
  +
               if (desc != null) {
                   possibleOperations = desc.getOperationsByQName(qname);
                   setOperationStyle(desc.getStyle());
  @@ -261,7 +261,7 @@
       public static MessageContext getCurrentContext() {
          return AxisEngine.getCurrentMessageContext();
       }
  -    
  +
       protected static String systemTempDir= null;
       static {
           try {
  @@ -296,6 +296,13 @@
               if(attachmentsdir != null){
                   setProperty(ATTACHMENTS_DIR, attachmentsdir);
               }
  +
  +            // If SOAP 1.2 has been specified as the default for the engine,
  +            // switch the constants over.
  +            String defaultSOAPVersion = (String)engine.getOption(
  +                                                 AxisEngine.PROP_SOAP_VERSION);
  +            if (defaultSOAPVersion != null && "1.2".equals(defaultSOAPVersion))
  +                soapConstants = SOAPConstants.SOAP12_CONSTANTS;
           }
       }
   
  @@ -444,12 +451,12 @@
   
             //if we have received attachments of a particular type
             // than that should be the default type to send.
  -          Message reqMsg= getRequestMessage(); 
  +          Message reqMsg= getRequestMessage();
             if( null != reqMsg){
               Attachments reqAttch= reqMsg.getAttachmentsImpl();
               Attachments respAttch= respMsg.getAttachmentsImpl();
               if(null != reqAttch  && null != respAttch){
  -              if(respAttch.getSendType() == Attachments.SEND_TYPE_NOTSET)  
  +              if(respAttch.getSendType() == Attachments.SEND_TYPE_NOTSET)
                   respAttch.setSendType(reqAttch.getSendType());//only if not explicity set.
               }
             }
  @@ -658,9 +665,9 @@
   
       /** The value of the property is used by service WSDL generation (aka ?WSDL)
        *  Set this property to request a certain level of HTTP.
  -     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_10
  
  +     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_10
        *    for HTTP 1.0
  -     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_11
  
  +     *  The values MUST use org.apache.axis.transport.http.HTTPConstants.HEADER_PROTOCOL_11
        *    for HTTP 1.1
        */
       public static String HTTP_TRANSPORT_VERSION  = "axis.transport.version";
  @@ -713,7 +720,7 @@
       public void setProperty(String name, Object value) {
           if (name == null || value == null) {
               return;
  -            // Is this right?  Shouldn't we throw an exception like: 
  +            // Is this right?  Shouldn't we throw an exception like:
               // throw new IllegalArgumentException(msg);
           }
           else if (name.equals(Call.USERNAME_PROPERTY)) {
  
  
  
  1.89      +3 -2      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- AxisEngine.java	8 Jul 2002 16:37:36 -0000	1.88
  +++ AxisEngine.java	10 Jul 2002 03:36:59 -0000	1.89
  @@ -97,9 +97,10 @@
       public static final String PROP_ATTACHMENT_IMPLEMENTATION  = "attachments.implementation"
;
       public static final String PROP_ATTACHMENT_CLEANUP = "attachment.DirectoryCleanUp";
       public static final String PROP_CONFIG_CLASS = "axis.engineConfigClass";
  +    public static final String PROP_SOAP_VERSION = "defaultSOAPVersion";
   
       public static final String DEFAULT_ATTACHMENT_IMPL="org.apache.axis.attachments.AttachmentsImpl";
  -    
  +
       public static final String ENV_ATTACHMENT_DIR = "axis.attachments.Directory";
       public static final String ENV_SERVLET_REALPATH = "servlet.realpath";
       public static final String ENV_SERVLET_CONTEXT = "servletContext";
  @@ -403,7 +404,7 @@
       public ClassCache getClassCache() {
           return classCache;
       }
  -    
  +
       protected void invokeJAXRPCHandlers(MessageContext context){
           org.apache.axis.client.Service service = (org.apache.axis.client.Service) context.getProperty(org.apache.axis.client.Call.WSDL_SERVICE);
           if(service == null)
  
  
  
  1.157     +14 -3     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.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- Call.java	8 Jul 2002 16:37:37 -0000	1.156
  +++ Call.java	10 Jul 2002 03:36:59 -0000	1.157
  @@ -55,7 +55,6 @@
   
   package org.apache.axis.client ;
   
  -import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
   import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
  @@ -63,6 +62,7 @@
   import org.apache.axis.InternalException;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.soap.SOAPConstants;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ParameterDesc;
   import org.apache.axis.enum.Style;
  @@ -1192,6 +1192,17 @@
       }
   
       /**
  +     * Allow the user to set the default SOAP version.  For SOAP 1.2, pass
  +     * SOAPConstants.SOAP12_CONSTANTS.
  +     *
  +     * @param soapConstants the SOAPConstants object representing the correct
  +     *                      version
  +     */
  +    public void setSOAPVersion(SOAPConstants soapConstants) {
  +        msgContext.setSOAPConstants(soapConstants);
  +    }
  +
  +    /**
        * Invokes a specific operation using a synchronous request-response interaction mode.
The invoke method takes
        * as parameters the object values corresponding to these defined parameter types.
Implementation of the invoke
        * method must check whether the passed parameter values correspond to the number,
order and types of parameters
  @@ -1257,7 +1268,7 @@
           if ( params != null && params.length > 0 && i == params.length
) {
               /* ok, we're doing Messaging, so build up the message */
               /******************************************************/
  -            env = new SOAPEnvelope();
  +            env = new SOAPEnvelope(msgContext.getSOAPConstants());
   
               if ( !(params[0] instanceof SOAPEnvelope) )
                   for ( i = 0 ; i < params.length ; i++ )
  @@ -1799,7 +1810,7 @@
               log.error(JavaUtils.getMessage("mustSpecifyReturnType"));
           }
   
  -        SOAPEnvelope         reqEnv = new SOAPEnvelope();
  +        SOAPEnvelope         reqEnv = new SOAPEnvelope(msgContext.getSOAPConstants());
           SOAPEnvelope         resEnv = null ;
           Message              reqMsg = new Message( reqEnv );
           Message              resMsg = null ;
  
  
  

Mime
View raw message