rubys       01/08/02 09:49:26

  Modified:    java/samples/interop EchoTestClient.java
               java/src/org/apache/soap/rpc Call.java
  Log:
  Added a timeout
  
  Revision  Changes    Path
  1.12      +1 -0      xml-soap/java/samples/interop/EchoTestClient.java
  
  Index: EchoTestClient.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/samples/interop/EchoTestClient.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EchoTestClient.java       2001/08/01 12:56:05     1.11
  +++ EchoTestClient.java       2001/08/02 16:49:26     1.12
  @@ -236,6 +236,7 @@
           soapAction = soapAction + methodName;
         }
         
  +      call.setTimeout(60000);
         Response resp = call.invoke(url, soapAction);
         
         // check response 
  
  
  
  1.12      +23 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Call.java 2001/06/28 21:04:03     1.11
  +++ Call.java 2001/08/02 16:49:26     1.12
  @@ -87,6 +87,7 @@
     private DocumentBuilder     xdb = XMLParserUtils.getXMLDocBuilder();
     private SOAPMappingRegistry smr = null;
     private SOAPTransport       st  = null;;
  +  private int                 to  = 0;
   
     public Call()
     {
  @@ -133,6 +134,24 @@
     }
   
     /**
  +   * Set timeout in our MessageContext.
  +   * 
  +   * @param value the maximum amount of time, in milliseconds
  +   */
  +  public void setTimeout (int value) {
  +    to = value;
  +  }
  +    
  +  /**
  +   * Get timeout from our MessageContext.
  +   * 
  +   * @return value the maximum amount of time, in milliseconds
  +   */
  +  public int getTimeout () {
  +    return to;
  +  }
  +    
  +  /**
      * Add a MIME BodyPart.
      *
      * @param  part  The Part to be appended
  @@ -212,6 +231,10 @@
         // Construct default HTTP transport if not specified.
         if (st == null)
           st = new SOAPHTTPConnection();
  +
  +      // set the timeout
  +      if (to != 0 && st instanceof SOAPHTTPConnection) 
  +        ((SOAPHTTPConnection)st).setTimeout(to);
   
         // Post the call envelope.
         st.send(url, SOAPActionURI, null, callEnv, smr, ctx);
  
  
  

Reply via email to