ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Narayanan Seshadri <Naraya...@Yodlee.com>
Subject Using different socket implementation
Date Sun, 03 Sep 2000 20:25:42 GMT
Hi,

I am developing an application where we need to support different
implementations of SSL.
I am thinking of abstracting the HTTPUtils to accept any socket
implementation.


SOAPHTTPConnection will pass IConnection interface which will tell how to
create a socket.

public interface IConnection {
   Socket createSocket(String host, int port) throws IOException;
}


in SOAPHTTPConnection the change would be in the call for HTTPUtils.post

the change will be

HTTPUtils.Response response = HTTPUtils.post(connection, sendTo, headers,
                Constants.HEADERVAL_CONTENT_TYPE,
                payloadSW.toString ());

where connection is IConnection.

HTTPUtils can create a socket using

Socket socket = connection.createSocket(host, port);


The advantage of using this is, the users can pass any implementation of
IConnection and can set additional parameters (like proxy, extra headers) in
the appropriate implementation.

Any thoughts?

-Narayanan

Mime
View raw message