Spring Web Services Framework

org.springframework.ws.transport.http
Class HttpUrlConnectionMessageSender

java.lang.Object
  extended by org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
      extended by org.springframework.ws.transport.http.HttpUrlConnectionMessageSender
All Implemented Interfaces:
WebServiceMessageSender
Direct Known Subclasses:
HttpsUrlConnectionMessageSender

public class HttpUrlConnectionMessageSender
extends AbstractHttpWebServiceMessageSender

WebServiceMessageSender implementation that uses standard J2SE facilities to execute POST requests, without support for HTTP authentication or advanced configuration options.

Designed for easy subclassing, customizing specific template methods. However, consider CommonsHttpMessageSender for more sophisticated needs: the J2SE HttpURLConnection is rather limited in its capabilities.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
HttpURLConnection

Field Summary
 
Fields inherited from class org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender
logger
 
Constructor Summary
HttpUrlConnectionMessageSender()
           
 
Method Summary
 WebServiceConnection createConnection(URI uri)
          Create a new WebServiceConnection to the specified URI.
protected  void prepareConnection(HttpURLConnection connection)
          Template method for preparing the given HttpURLConnection.
 
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
 

Constructor Detail

HttpUrlConnectionMessageSender

public HttpUrlConnectionMessageSender()
Method Detail

createConnection

public WebServiceConnection createConnection(URI uri)
                                      throws IOException
Description copied from interface: WebServiceMessageSender
Create a new WebServiceConnection to the specified URI.

Parameters:
uri - the URI to open a connection to
Returns:
the new connection
Throws:
IOException - in case of I/O errors

prepareConnection

protected void prepareConnection(HttpURLConnection connection)
                          throws IOException
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.

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

Spring Web Services Framework

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