RE: Re: How to set an SSL socket connect timeout value?

2005-12-28 Thread David Penaskovic
AFAIK, yes.

There is a socket connect timeout, when the socket is initially created.
And there is a socket timeout. I believe calling stub.setTimeout is
setting
the latter.

The classes are DefaultSocketFactory (HTTP) and JSSESocketFactory
(HTTPS).

When running java 1.4, as stated, the DefaultSocketFactory will create
the socket with a connect timeout if axis.client.connect.timeout is
set.

But the JSSESocketFactory does not seem to do the same.

dave



-Original Message-
From: Liu, Tao [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 28, 2005 7:49 AM
To: 'axis-user@ws.apache.org'
Subject: RE: Re: How to set an SSL socket connect timeout value?

Are there two types of timeouts discussed here? One is Connection
Timeout
and the other is Socket Timeout.

The connection timeout can be set only in Java 1.4 and above, but I
don't
know how to set it in Axis 1.x since it need to support Java 1.3.

I plan to move to Axis2.

Thanks,
Tao


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 27, 2005 9:31 PM
To: axis-user@ws.apache.org
Subject: RE: Re: How to set an SSL socket connect timeout value?


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 = 1; // 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:
axis-user@ws.apache.org   
  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: 'axis-user@ws.apache.org'
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: axis-user@ws.apache.org
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

RE: Re: How to set an SSL socket connect timeout value?

2005-12-27 Thread David Penaskovic
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: axis-user@ws.apache.org
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);





RE: Re: How to set an SSL socket connect timeout value?

2005-12-27 Thread David Penaskovic
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: 'axis-user@ws.apache.org'
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: axis-user@ws.apache.org
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);





How to set an SSL socket connect timeout value?

2005-12-21 Thread David Penaskovic
I am using JDK 1.4.2 and axis-1.3.*

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.

For http connections, I am successfully able to set this axis property:

axis.client.connect.timeout

and the org.apache.axis.components.net.DefaultSocketFactory
does create a socket with an initial connect timeout as specified.

But for https connections, the JSSESocketFactory class does not do this.
Any ideas on how to set the socket connect timeout for SSL connections?