Spring Web Services Framework

org.springframework.ws.transport.http
Class HttpsUrlConnectionMessageSender

java.lang.Object
  extended by org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
      extended by org.springframework.ws.transport.http.HttpUrlConnectionMessageSender
          extended by org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender
All Implemented Interfaces:
InitializingBean, WebServiceMessageSender

public class HttpsUrlConnectionMessageSender
extends HttpUrlConnectionMessageSender
implements InitializingBean

Extension of HttpUrlConnectionMessageSender that adds support for (self-signed) HTTPS certificates.

Since:
1.5.8
Author:
Alex Marshall, Arjen Poutsma

Field Summary
static String DEFAULT_SSL_PROTOCOL
          The default SSL protocol.
 
Fields inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
logger
 
Constructor Summary
HttpsUrlConnectionMessageSender()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void prepareConnection(HttpURLConnection connection)
          Template method for preparing the given HttpURLConnection.
 void setHostnameVerifier(HostnameVerifier hostnameVerifier)
          Specifies the host name verifier to use for this message sender.
 void setKeyManagers(KeyManager[] keyManagers)
          Specifies the key managers to use for this message sender.
 void setSecureRandom(SecureRandom rnd)
          Specifies the secure random to use for this message sender.
 void setSslProtocol(String sslProtocol)
          Sets the SSL protocol to use.
 void setSslProvider(String sslProvider)
          Sets the SSL provider to use.
 void setTrustManagers(TrustManager[] trustManagers)
          Specifies the trust managers to use for this message sender.
 
Methods inherited from class org.springframework.ws.transport.http.HttpUrlConnectionMessageSender
createConnection
 
Methods inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
isAcceptGzipEncoding, setAcceptGzipEncoding, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SSL_PROTOCOL

public static final String DEFAULT_SSL_PROTOCOL
The default SSL protocol.

See Also:
Constant Field Values
Constructor Detail

HttpsUrlConnectionMessageSender

public HttpsUrlConnectionMessageSender()
Method Detail

setSslProtocol

public void setSslProtocol(String sslProtocol)
Sets the SSL protocol to use. Default is ssl.

See Also:
SSLContext.getInstance(String, String)

setSslProvider

public void setSslProvider(String sslProvider)
Sets the SSL provider to use. Default is empty, to use the default provider.

See Also:
SSLContext.getInstance(String, String)

setKeyManagers

public void setKeyManagers(KeyManager[] keyManagers)
Specifies the key managers to use for this message sender.

Setting either this property or trustManagers is required.

See Also:
SSLContext.init(KeyManager[], TrustManager[], SecureRandom)

setTrustManagers

public void setTrustManagers(TrustManager[] trustManagers)
Specifies the trust managers to use for this message sender.

Setting either this property or keyManagers is required.

See Also:
SSLContext.init(KeyManager[], TrustManager[], SecureRandom)

setHostnameVerifier

public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
Specifies the host name verifier to use for this message sender.

See Also:
HttpsURLConnection.setHostnameVerifier(HostnameVerifier)

setSecureRandom

public void setSecureRandom(SecureRandom rnd)
Specifies the secure random to use for this message sender.

See Also:
SSLContext.init(KeyManager[], TrustManager[], SecureRandom)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

prepareConnection

protected void prepareConnection(HttpURLConnection connection)
                          throws IOException
Description copied from class: HttpUrlConnectionMessageSender
Template method for preparing the given HttpURLConnection.

The default implementation prepares the connection for input and output, sets the HTTP method to POST, disables caching, and sets the Accept-Encoding header to gzip, if applicable.

Overrides:
prepareConnection in class HttpUrlConnectionMessageSender
Parameters:
connection - the connection to prepare
Throws:
IOException - in case of I/O errors

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.