axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/message RPCHandler.java
Date Thu, 08 Nov 2001 12:53:10 GMT
dug         01/11/08 04:53:10

  Modified:    java/src/org/apache/axis MessageContext.java
               java/src/org/apache/axis/client Call.java
               java/src/org/apache/axis/message RPCHandler.java
  Log:
  Fix RPC case where no xsi:type is specified - grab type from Call object.
  This fixes the test Glen added last night.
  
  Revision  Changes    Path
  1.64      +4 -1      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.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- MessageContext.java	2001/10/31 23:50:19	1.63
  +++ MessageContext.java	2001/11/08 12:53:10	1.64
  @@ -423,7 +423,10 @@
       public static String AUTHUSER            = "authenticatedUser";
   
       /** Is this message an RPC message (instead of just a blob of xml) */
  -    public static String ISRPC               ="is_rpc" ;
  +    public static String ISRPC               = "is_rpc" ;
  +  
  +    /** If on the client - this is the Call object */
  +    public static String CALL                = "call_object" ;
   
       /** Just a util so we don't have to cast the result
        */
  
  
  
  1.33      +11 -0     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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Call.java	2001/11/06 15:41:25	1.32
  +++ Call.java	2001/11/08 12:53:10	1.33
  @@ -237,6 +237,16 @@
       }
   
       /**
  +     * Returns the XMLType of the return value of this Call - or null if
  +     * not set.
  +     *
  +     * @return the XMLType specified for this Call (or null).
  +     */
  +    public XMLType getReturnType() {
  +        return( returnType );
  +    }
  +
  +    /**
        * Clears the list of parameters.
        */
       public void removeAllParameters() {
  @@ -948,6 +958,7 @@
           category.debug(JavaUtils.getMessage("enter00", "Call::invoke()") );
   
           msgContext.reset();
  +        msgContext.setProperty( MessageContext.CALL, this );
   
           if (myProperties != null) {
               Enumeration enum = myProperties.keys();
  
  
  
  1.17      +19 -1     xml-axis/java/src/org/apache/axis/message/RPCHandler.java
  
  Index: RPCHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- RPCHandler.java	2001/11/07 19:00:42	1.16
  +++ RPCHandler.java	2001/11/08 12:53:10	1.17
  @@ -62,10 +62,13 @@
   
   import org.apache.axis.Constants;
   import org.apache.axis.Handler;
  +import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.client.Call;
   import org.apache.axis.encoding.DeserializationContext;
   import org.apache.axis.encoding.Deserializer;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.XMLType;
   import org.apache.axis.utils.AxisClassLoader;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.cache.JavaClass;
  @@ -168,8 +171,23 @@
               // NOTE : We don't check params.isEmpty() here because we
               //        must have added at least one above...
               //
  -            if (type==null && defaultParamTypes!=null &&
  +
  +            // No xsi:type so in the return rpc case try to get it from
  +            // the Call object
  +            MessageContext msgContext = context.getMessageContext();
  +            Message        msg = msgContext.getCurrentMessage();
  +            if ( msg != null && msg.getMessageType() == Message.RESPONSE ) {
  +                Call c = (Call) msgContext.getProperty( MessageContext.CALL );
  +                if ( c != null ) {
  +                    XMLType xmlType = (XMLType) c.getReturnType();
  +                    if ( xmlType != null )
  +                        type = xmlType.getType();
  +                }
  +            }
  +
  +            if (defaultParamTypes!=null &&
                   params.size()<=defaultParamTypes.length) {
  +
                   TypeMappingRegistry typeMap = context.getTypeMappingRegistry();
                   int index = params.size()-1;
                   if (index+1<defaultParamTypes.length)
  
  
  

Mime
View raw message