HttpInvokerRequestExecutor 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 CommonsHttpInvokerRequestExecutor for more sophisticated
needs: The J2SE HttpURLConnection is rather limited in its capabilities.
author: Juergen Hoeller since: 1.1 See Also:CommonsHttpInvokerRequestExecutor See Also:java.net.HttpURLConnection
Determine whether the given response is a GZIP response.
Default implementation checks whether the HTTP "Content-Encoding"
header contains "gzip" (in any casing).
Parameters: con - the HttpURLConnection to check
Open an HttpURLConnection for the given remote invocation request.
Parameters: config - the HTTP invoker configuration that specifies thetarget service the HttpURLConnection for the given request throws: IOException - if thrown by I/O methods See Also:java.net.URL.openConnection
The default implementation specifies POST as method,
"application/x-java-serialized-object" as "Content-Type" header,
and the given content length as "Content-Length" header.
Parameters: con - the HTTP connection to prepare Parameters: contentLength - the length of the content to send throws: IOException - if thrown by HttpURLConnection methods See Also:java.net.HttpURLConnection.setRequestMethod See Also:java.net.HttpURLConnection.setRequestProperty
Validate the given response as contained in the HttpURLConnection object,
throwing an exception if it does not correspond to a successful HTTP response.
Default implementation rejects any HTTP status code beyond 2xx, to avoid
parsing the response body and trying to deserialize from a corrupted stream.
Parameters: config - the HTTP invoker configuration that specifies the target service Parameters: con - the HttpURLConnection to validate throws: IOException - if validation failed See Also:java.net.HttpURLConnection.getResponseCode
Set the given serialized remote invocation as request body.
The default implementation simply write the serialized invocation to the
HttpURLConnection's OutputStream. This can be overridden, for example, to write
a specific encoding and potentially set appropriate HTTP request headers.
Parameters: config - the HTTP invoker configuration that specifies the target service Parameters: con - the HttpURLConnection to write the request body to Parameters: baos - the ByteArrayOutputStream that contains the serializedRemoteInvocation object throws: IOException - if thrown by I/O methods See Also:java.net.HttpURLConnection.getOutputStream See Also:java.net.HttpURLConnection.setRequestProperty
Fields inherited from org.springframework.remoting.httpinvoker.AbstractHttpInvokerRequestExecutor