You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by du...@locus.apache.org on 2000/11/20 14:46:45 UTC

cvs commit: xml-soap/java/src/org/apache/soap/rpc Call.java RPCMessage.java

dug         00/11/20 05:46:43

  Modified:    java/src/org/apache/soap/providers TemplateProvider.java
               java/src/org/apache/soap/rpc Call.java RPCMessage.java
  Log:
  Removed some tabs and added support for passing back a new 'instance-id' in the URN.
  
  Revision  Changes    Path
  1.2       +21 -17    xml-soap/java/src/org/apache/soap/providers/TemplateProvider.java
  
  Index: TemplateProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/providers/TemplateProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TemplateProvider.java	2000/11/07 00:34:58	1.1
  +++ TemplateProvider.java	2000/11/20 13:44:38	1.2
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2000 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
  @@ -26,7 +26,7 @@
    *
    * 4. The names "SOAP" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -73,12 +73,12 @@
       private HttpServlet          servlet ;
       private HttpSession          session ;
   
  -    public void locate( DeploymentDescriptor dd, 
  -                        Call call, 
  -                        String targetObjectURI, 
  -			HttpServlet servlet,
  -			HttpSession session)
  -	throws SOAPException {
  +    public void locate( DeploymentDescriptor dd,
  +                        Call call,
  +                        String targetObjectURI,
  +                        HttpServlet servlet,
  +                        HttpSession session)
  +        throws SOAPException {
         System.err.println( "=============================================" );
         System.err.println( "In TemplateProvider.locate()" );
         System.err.println( "URI: " + targetObjectURI );
  @@ -92,8 +92,8 @@
         System.err.println( "Options:" );
         while ( keys.hasMoreElements() ) {
             String  key   = (String) keys.nextElement();
  -	  String  value = (String) props.get( key );
  -	  System.err.println( "Key: " + key + "  Value: " + value );
  +          String  value = (String) props.get( key );
  +          System.err.println( "Key: " + key + "  Value: " + value );
         }
   
         this.dd              = dd ;
  @@ -108,15 +108,19 @@
   
       public Response invoke() throws SOAPException {
         System.err.println( "=============================================" );
  -      System.err.println("In TemplateProvider.invoke()" );
  -      
  +      System.err.println( "In TemplateProvider.invoke()" );
  +
         // Add logic to invoke the service and get back the result here
   
  +      // If you want the client to use a new targetObjectURI for subsequence
  +      // calls place it here (targetObjectURI on 'new Response').
  +      //   i.e. we added an 'instance-id' to the urn
  +
         return new Response( targetObjectURI,            // URI
                              call.getMethodName(),       // Method
  -			   (Parameter) null,           // ReturnValue
  +                           (Parameter) null,           // ReturnValue
                              null,                       // Params
  -			   null,                       // Header
  -			   null );                     // encoding
  +                           null,                       // Header
  +                           null );                     // encoding
       };
   };
  
  
  
  1.4       +3 -0      xml-soap/java/src/org/apache/soap/rpc/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/Call.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Call.java	2000/09/18 15:12:06	1.3
  +++ Call.java	2000/11/20 13:45:42	1.4
  @@ -180,6 +180,9 @@
         // Extract the response from the response envelope.
         Response resp = Response.extractFromEnvelope(respEnv, smr);
   
  +      // Reset the TargetObjectURI in case it was changed by the server
  +      setTargetObjectURI( resp.getFullTargetObjectURI() );
  +
         return resp;
       }
       catch (IllegalArgumentException e)
  
  
  
  1.7       +7 -2      xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java
  
  Index: RPCMessage.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RPCMessage.java	2000/11/08 12:58:20	1.6
  +++ RPCMessage.java	2000/11/20 13:45:48	1.7
  @@ -108,6 +108,11 @@
       return targetObjectURI;
     }
   
  +  public void setFullTargetObjectURI(String targetObjectURI)
  +  {
  +    setTargetObjectURI(targetObjectURI);
  +  }
  +
     public String getFullTargetObjectURI()
     {
       return fullTargetObjectURI;
  @@ -489,10 +494,10 @@
   
       RPCMessage msg = isResponse
                        ? (fault == null
  -                        ? (RPCMessage)new Response(targetObjectURI, methodName,
  +                        ? (RPCMessage)new Response(fullTargetObjectURI, methodName,
                                                      returnValue, params, null,
                                                      declMsgEncStyle)
  -                        : (RPCMessage)new Response(targetObjectURI, methodName,
  +                        : (RPCMessage)new Response(fullTargetObjectURI, methodName,
                                                      fault, params, null,
                                                      declMsgEncStyle))
                        : (RPCMessage)new Call(fullTargetObjectURI, methodName,