Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


org.apache.soap.transport.http
Class SOAPHTTPConnection

java.lang.Object
  extended byorg.apache.soap.transport.http.SOAPHTTPConnection

All Implemented Interfaces:
SOAPTransport

public class SOAPHTTPConnection
extends java.lang.Object
implements SOAPTransport

SOAPHTTPConnection is an implementation of the SOAPTransport interface for HTTP.


Constructor Summary
SOAPHTTPConnection()

Method Summary
Cookie[] getCookies()
Gets the cookies.
Cookie[] getCookies2()
Gets the cookie2's.
java.util.Hashtable getHeaders()
Return access to headers generated by the protocol.
boolean getMaintainSession()
Return session maintanence status.
int getOutputBufferSize()
Gets the output buffer size (in bytes).
java.lang.String getProxyHost()
Get HTTP proxy host.
int getProxyPort()
Get HTTP proxy port.
java.lang.StringBuffer getRequestCopy()
Get Buffer containing copy of the request.
java.lang.StringBuffer getResponseCopy()
Get Buffer containing copy of the response.
SOAPContext getResponseSOAPContext()
Return the SOAPContext associated with the response.
java.lang.Boolean getTcpNoDelay()
Get the TCPNoDelay setting.
int getTimeout()
Get the HTTP read timeout.
java.io.BufferedReader receive()
Return a buffered reader to receive back the response to whatever was sent to whatever.
void send(java.net.URL sendTo, java.lang.String action, java.util.Hashtable headers, Envelope env, SOAPMappingRegistry smr, SOAPContext ctx)
This method is used to request that an envelope be posted to the given URL.
void setCookies(Cookie[] cookies)
Sets the cookies.
void setCookies2(Cookie[] cookies2)
Sets the cookie2's.
void setMaintainSession(boolean maintainSession)
Indicate whether to maintain HTTP sessions.
void setOutputBufferSize(int sz)
Sets the output buffer size (in bytes).
void setPassword(java.lang.String password)
Set the password for HTTP Basic authentication.
void setProxyHost(java.lang.String host)
Set HTTP proxy host.
void setProxyPassword(java.lang.String password)
Set the password for HTTP proxy basic authentication.
void setProxyPort(int port)
Set HTTP proxy port.
void setProxyUserName(java.lang.String userName)
Set the username for HTTP proxy basic authentication.
void setRequestCopy(java.lang.StringBuffer requestCopy)
Set buffer for capturing copy of the request.
void setResponseCopy(java.lang.StringBuffer responseCopy)
Set buffer for capturing copy of the response.
void setTcpNoDelay(java.lang.Boolean nodelay)
Set the TCPNoDelay setting.
void setTimeout(int timeout)
Set the HTTP read timeout.
void setUserName(java.lang.String userName)
Set the username for HTTP Basic authentication.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

SOAPHTTPConnection

public SOAPHTTPConnection()

Method Detail

setProxyHost

public void setProxyHost(java.lang.String host)
Set HTTP proxy host.
Parameters:
host - the HTTP proxy host or null if no proxy.

setProxyPort

public void setProxyPort(int port)
Set HTTP proxy port.

getProxyHost

public java.lang.String getProxyHost()
Get HTTP proxy host.
Returns:
the HTTP proxy host or null if no proxy.

getProxyPort

public int getProxyPort()
Get HTTP proxy port.
Returns:
the HTTP proxy port. Invalid if getProxyHost() returns null.

setUserName

public void setUserName(java.lang.String userName)
Set the username for HTTP Basic authentication.

setPassword

public void setPassword(java.lang.String password)
Set the password for HTTP Basic authentication.

setProxyUserName

public void setProxyUserName(java.lang.String userName)
Set the username for HTTP proxy basic authentication.

setProxyPassword

public void setProxyPassword(java.lang.String password)
Set the password for HTTP proxy basic authentication.

setRequestCopy

public void setRequestCopy(java.lang.StringBuffer requestCopy)
Set buffer for capturing copy of the request.

setResponseCopy

public void setResponseCopy(java.lang.StringBuffer responseCopy)
Set buffer for capturing copy of the response.

getRequestCopy

public java.lang.StringBuffer getRequestCopy()
Get Buffer containing copy of the request.
Returns:
the Buffer containing copy of the request. Returns null if buffer has not been previously set.

getResponseCopy

public java.lang.StringBuffer getResponseCopy()
Get Buffer containing copy of the response.
Returns:
the Buffer containing copy of the response. Returns null if buffer has not been previously set.

setMaintainSession

public void setMaintainSession(boolean maintainSession)
Indicate whether to maintain HTTP sessions.

getMaintainSession

public boolean getMaintainSession()
Return session maintanence status.

getCookies

public Cookie[] getCookies()
Gets the cookies. These are set with each HTTP response, but can be altered. Important: this returns the internal array, not a copy.
Returns:
The cookies.

setCookies

public void setCookies(Cookie[] cookies)
Sets the cookies. These will be used for the next HTTP request, but will be overwritten based on the response. Important: if improperly altered, the connection may lose its association with a session.
Parameters:
cookies - The cookies.

getCookies2

public Cookie[] getCookies2()
Gets the cookie2's. These are set with each HTTP response, but can be altered. Important: this returns the internal array, not a copy.
Returns:
The cookie2's.

setCookies2

public void setCookies2(Cookie[] cookies2)
Sets the cookie2's. These will be used for the next HTTP request, but will be overwritten based on the response. Important: if improperly altered, the connection may lose its association with a session.
Parameters:
cookies2 - The cookie2's.

setTimeout

public void setTimeout(int timeout)
Set the HTTP read timeout.
Parameters:
timeout - the amount of time, in ms, to block on reading data. A zero value indicates an infinite timeout.

getTimeout

public int getTimeout()
Get the HTTP read timeout.
Returns:
the amount of time, in ms, to block on reading data.

setOutputBufferSize

public void setOutputBufferSize(int sz)
Sets the output buffer size (in bytes).
Parameters:
sz - The output buffer size (in bytes).

getOutputBufferSize

public int getOutputBufferSize()
Gets the output buffer size (in bytes).
Returns:
The output buffer size (in bytes).

getTcpNoDelay

public java.lang.Boolean getTcpNoDelay()
Get the TCPNoDelay setting.
Returns:
the TCPNoDelay setting.

setTcpNoDelay

public void setTcpNoDelay(java.lang.Boolean nodelay)
Set the TCPNoDelay setting. Setting this to true will disable Nagle's algorithm for TCP. The default is false.

send

public void send(java.net.URL sendTo,
                 java.lang.String action,
                 java.util.Hashtable headers,
                 Envelope env,
                 SOAPMappingRegistry smr,
                 SOAPContext ctx)
          throws SOAPException
This method is used to request that an envelope be posted to the given URL. The response (if any) must be gotten by calling the receive() function.
Specified by:
send in interface SOAPTransport
Parameters:
sendTo - the URL to send the envelope to
action - the SOAPAction header field value
headers - any other header fields to go to as protocol headers
env - the envelope to send
smr - the XML<->Java type mapping registry (passed on)
ctx - the request SOAPContext
Throws:
SOAPException - with appropriate reason code if problem

receive

public java.io.BufferedReader receive()
Return a buffered reader to receive back the response to whatever was sent to whatever.
Specified by:
receive in interface SOAPTransport
Returns:
a reader to read the results from or null if that's not possible.

getHeaders

public java.util.Hashtable getHeaders()
Return access to headers generated by the protocol.
Specified by:
getHeaders in interface SOAPTransport
Returns:
a hashtable containing all the headers

getResponseSOAPContext

public SOAPContext getResponseSOAPContext()
Return the SOAPContext associated with the response.
Specified by:
getResponseSOAPContext in interface SOAPTransport
Returns:
response SOAPContext

Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


Copyright © 2001 The Apache Software Foundation. All rights reserved.