Package org.apache.xmlrpc.client
Class XmlRpcHttpTransport
- java.lang.Object
-
- org.apache.xmlrpc.client.XmlRpcTransportImpl
-
- org.apache.xmlrpc.client.XmlRpcStreamTransport
-
- org.apache.xmlrpc.client.XmlRpcHttpTransport
-
- All Implemented Interfaces:
XmlRpcTransport
- Direct Known Subclasses:
XmlRpcLiteHttpTransport
,XmlRpcSunHttpTransport
public abstract class XmlRpcHttpTransport extends XmlRpcStreamTransport
Abstract base implementation of an HTTP transport. Base class for the concrete implementations, likeXmlRpcSunHttpTransport
, ororg.apache.xmlrpc.client.XmlRpcCommonsTransport
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
XmlRpcHttpTransport.ByteArrayReqWriter
-
Nested classes/interfaces inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
XmlRpcStreamTransport.GzipReqWriter, XmlRpcStreamTransport.ReqWriter, XmlRpcStreamTransport.ReqWriterImpl
-
-
Field Summary
Fields Modifier and Type Field Description static String
USER_AGENT
The user agent string.
-
Constructor Summary
Constructors Modifier Constructor Description protected
XmlRpcHttpTransport(XmlRpcClient pClient, String pUserAgent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
getUserAgent()
protected void
initHttpHeaders(XmlRpcRequest pRequest)
protected boolean
isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig)
protected XmlRpcStreamTransport.ReqWriter
newReqWriter(XmlRpcRequest pRequest)
Creates a new instance ofXmlRpcStreamTransport.ReqWriter
.Object
sendRequest(XmlRpcRequest pRequest)
Send an XML-RPC message.protected void
setCompressionHeaders(XmlRpcHttpClientConfig pConfig)
protected void
setContentLength(int pLength)
protected void
setCredentials(XmlRpcHttpClientConfig pConfig)
protected abstract void
setRequestHeader(String pHeader, String pValue)
-
Methods inherited from class org.apache.xmlrpc.client.XmlRpcStreamTransport
close, getInputStream, isCompressingRequest, isResponseGzipCompressed, newXMLReader, readResponse, writeRequest
-
Methods inherited from class org.apache.xmlrpc.client.XmlRpcTransportImpl
getClient
-
-
-
-
Field Detail
-
USER_AGENT
public static final String USER_AGENT
The user agent string.
-
-
Constructor Detail
-
XmlRpcHttpTransport
protected XmlRpcHttpTransport(XmlRpcClient pClient, String pUserAgent)
-
-
Method Detail
-
getUserAgent
protected String getUserAgent()
-
setCredentials
protected void setCredentials(XmlRpcHttpClientConfig pConfig) throws XmlRpcClientException
- Throws:
XmlRpcClientException
-
setContentLength
protected void setContentLength(int pLength)
-
setCompressionHeaders
protected void setCompressionHeaders(XmlRpcHttpClientConfig pConfig)
-
initHttpHeaders
protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException
- Throws:
XmlRpcClientException
-
sendRequest
public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException
Description copied from interface:XmlRpcTransport
Send an XML-RPC message. This method is called to send a message to the other party.- Specified by:
sendRequest
in interfaceXmlRpcTransport
- Overrides:
sendRequest
in classXmlRpcStreamTransport
- Parameters:
pRequest
- The request being performed.- Returns:
- Result object, if invoking the remote method was successfull.
- Throws:
XmlRpcException
- Performing the request failed.
-
isUsingByteArrayOutput
protected boolean isUsingByteArrayOutput(XmlRpcHttpClientConfig pConfig)
-
newReqWriter
protected XmlRpcStreamTransport.ReqWriter newReqWriter(XmlRpcRequest pRequest) throws XmlRpcException, IOException, SAXException
Description copied from class:XmlRpcStreamTransport
Creates a new instance ofXmlRpcStreamTransport.ReqWriter
.- Overrides:
newReqWriter
in classXmlRpcStreamTransport
- Throws:
XmlRpcException
- Creating the instance failed.IOException
- Creating the instance failed, because anIOException
occurs.SAXException
- Creating the instance failed, because the request could not be parsed.
-
-