Hi,
As I need SSL connection through proxy, I have started looking
at version 2.3. Previous versions did not support this mode of
operation.
I found it rather difficult to see what is actually going
through the wire.
I have looked at the source (nightly build 2002-05-27), and
made the modifications shown bellow to SOAPHTTPConnection
and HTTPUtils.
I can now pass two StringBuffer objects to SOAPHTTPConnection
(using setRequestCopy() and setResponseCopy()), and after
making the call, read their content to see the raw HTTP �stuff�.
I would very much appreciate if this, or similar, mechanism
could be implemented sooner rather then later.
Kind Regards,
--
Arek Wnukowski
== HTTPUtils.diff ==
220a221,252
>
> return post(url, request, timeout, httpProxyHost, httpProxyPort,
> outputBufferSize, tcpNoDelay, null, null);
> }
>
> /**
> * POST something to the given URL. The headers are put in as
> * HTTP headers, the content length is calculated and the content
> * byte array is sent as the POST content.
> *
> * @param url the url to post to
> * @param request the message
> * @param timeout the amount of time, in ms, to block on reading data
> * @param httpProxyHost the HTTP proxy host or null if no proxy
> * @param httpProxyPort the HTTP proxy port, if the proxy host is not null
> * @param outputBufferSize the size of the output buffer on the HTTP stream
> * @param tcpNoDelay the tcpNoDelay setting for the socket
> * @param requestCopy the buffer for capturing copy of the request or null
> * if capture is not required.
> * @param responseCopy the buffer for capturing copy of the response or null
> * if capture is not required.
> * @param the tcpNoDelay setting for the socket
> * @return the response message
> */
> public static TransportMessage post(URL url, TransportMessage request,
> int timeout,
> String httpProxyHost, int httpProxyPort,
> int outputBufferSize,
> Boolean tcpNoDelay,
> StringBuffer requestCopy,
> StringBuffer responseCopy)
> throws IllegalArgumentException, IOException, SOAPException {
278a311,317
>
> /* If required, capture a copy of the request. */
> if (requestCopy != null) {
> requestCopy.append(headerbuf)
> .append(new String(request.getBytes()));
> }
>
318a358
>
371a412,416
> /* If required, capture a copy of the response. */
> if (responseCopy != null) {
> responseCopy.append(line).append("\r\n").append(new String(bytes));
> }
>
== HTTPUtils.diff ==
== SOAPHTTPConnection.diff ==
101a102,103
> private StringBuffer requestCopy = null;
> private StringBuffer responseCopy = null;
166a169,202
> /**
> * Set buffer for capturing copy of the request.
> */
> public void setRequestCopy (StringBuffer requestCopy) {
> this.requestCopy = requestCopy;
> }
>
> /**
> * Set buffer for capturing copy of the response.
> */
> public void setResponseCopy (StringBuffer responseCopy) {
> this.responseCopy = responseCopy;
> }
>
> /**
> * Get Buffer containing copy of the request.
> *
> * @return the Buffer containing copy of the request.
> * Returns null if buffer has not been previously set.
> */
> public StringBuffer getRequestCopy () {
> return requestCopy;
> }
>
> /**
> * Get Buffer containing copy of the response.
> *
> * @return the Buffer containing copy of the response.
> * Returns null if buffer has not been previously set.
> */
> public StringBuffer getResponseCopy () {
> return responseCopy;
> }
>
308a345
>
311c348,349
< outputBufferSize, tcpNoDelay);
---
> outputBufferSize, tcpNoDelay,
> requestCopy, responseCopy);
== SOAPHTTPConnection.diff ==