Author: mriou
Date: Tue Oct 17 08:48:41 2006
New Revision: 464947

URL: http://svn.apache.org/viewvc?view=rev&rev=464947
Log:
Adding timeout option.

Modified:
    
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ServiceClientUtil.java

Modified: 
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ServiceClientUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ServiceClientUtil.java?view=diff&rev=464947&r1=464946&r2=464947
==============================================================================
--- 
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ServiceClientUtil.java
 (original)
+++ 
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ServiceClientUtil.java
 Tue Oct 17 08:48:41 2006
@@ -45,9 +45,23 @@
      * @throws AxisFault when a problem occured during the call
      */
     public OMElement send(OMElement msg, String url) throws AxisFault {
+        return send(msg, url, Options.DEFAULT_TIMEOUT_MILLISECONDS);
+    }
+
+    /**
+     * Sends the provided message to an Axis2 deployed service allowing to set 
a
+     * specific timeout (in ms).
+     * @param msg the message OMElement that will be included in the body
+     * @param url to send the message to
+     * @param timeout in milliseconds
+     * @return the response message
+     * @throws AxisFault when a problem occured during the call
+     */
+    public OMElement send(OMElement msg, String url, long timeout) throws 
AxisFault {
         Options options = new Options();
         EndpointReference target = new EndpointReference(url);
         options.setTo(target);
+        options.setTimeOutInMilliSeconds(timeout);
 
         ServiceClient serviceClient = new ServiceClient();
         serviceClient.setOptions(options);


Reply via email to