Our Webservices are always SSL and we have always successfully timed out a
socket by calling setTimeout(InMillis) on org.apache.axis.client.Stub
instance. sample code is attached below.
if(port instanceof org.apache.axis.client.Stub){ // instanceof
and Class casting will always drag performance
org.apache.axis.client.Stub stub =
(org.apache.axis.client.Stub) port;
/**
* set the timeout to in MilliSeconds
*/
int timeOut = 10000; // 10 seconds
stub.setTimeout(timeOut);
return stub;
}
Have not yet looked at the underlying code to see how it works, but then
never had the need as it has been working like a charm. The same works fine
for non SSL socket too.
Thanks and Regards,
===
Gary Grewal
-
"David Penaskovic"
<[EMAIL PROTECTED] To:
<[email protected]>
r-peak.com> cc:
Subject: RE: Re: How to set
an SSL socket connect timeout value?
12/27/2005 01:56
PM
Please respond to
axis-user
Didn't finish. Apologies.
That method below, getSocket() in HTTPSender, uses the
timeout to call setSoTimeout(). But it is already too late,
the socket is already created. I need to set the *connect* timeout
at socket creation time.
The org.apache.axis.components.net.DefaultSocketFactory (used for HTTP)
does create a socket with a connect timeout if I've set the AXIS
property 'axis.client.connect.timeout'
But the org.apache.axis.components.net.JSSESocketFactory (used for
HTTPS) does not do this.
I can't seem to figure this out for SSL.
dave
-----Original Message-----
From: David Penaskovic
Sent: Tuesday, December 27, 2005 11:50 AM
To: '[email protected]'
Subject: RE: Re: How to set an SSL socket connect timeout value?
I don't believe that will work.
In class org.apache.axis.transport.http.HTTPSender, this method:
protected void getSocket(SocketHolder sockHolder,
MessageContext msgContext,
String protocol,
String host, int port, int timeout,
StringBuffer otherHeaders,
BooleanHolder useFullURL)
throws Exception
{
Hashtable options = getOptions();
if(timeout > 0) {
if(options == null) {
options = new Hashtable();
}
options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeou
t));
}
SocketFactory factory =
SocketFactoryFactory.getFactory(protocol, options);
if (factory == null) {
throw new IOException(Messages.getMessage("noSocketFactory",
protocol));
}
Socket sock = factory.create(host, port, otherHeaders,
useFullURL);
if(timeout > 0) {
sock.setSoTimeout(timeout);
}
sockHolder.setSocket(sock);
}
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong
Sent: Sunday, December 25, 2005 8:16 AM
To: [email protected]
Subject: Re: How to set an SSL socket connect timeout value?
David Penaskovic <DPenaskovic <at> silver-peak.com> writes:
> I can't figure out how to set the timeout value for an initial SSL
> socket connect. The default varies from platform to platform and I
would
> like to set this value explicitly.
Have you tried:
call.setTimeout(timeout);
This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates