org.apache.tsik.messaging
Class XmlTransportDoc

java.lang.Object
  extended byorg.apache.tsik.messaging.AbstractTransport
      extended byorg.apache.tsik.messaging.XmlTransportDoc
All Implemented Interfaces:
XmlTransport, XmlTransportSecurity

public class XmlTransportDoc
extends AbstractTransport

Provide a means of logging the raw XML request documents which would have been transmitted to a web service. Instantiate this class with an OutputStream to which the request message XML should be written.


Field Summary
 
Fields inherited from class org.apache.tsik.messaging.AbstractTransport
httpsTrustAdapter, responseValidity
 
Constructor Summary
XmlTransportDoc(OutputStream logOutput)
          Creates a transport for logging request messages.
 
Method Summary
protected  void logRequest(Document request, PrintStream log)
          Writes the request message to the given output stream.
 XmlResponse sendRequest(XmlRequest req)
          Overrides the normal transport mechanism to log the request message and return null.
 void setStream(OutputStream logOutput)
          Deprecated. please use AbstractTransport.setLogOutput(java.io.PrintStream).
 
Methods inherited from class org.apache.tsik.messaging.AbstractTransport
addRequestEnvelope, afterConnect, beforeConnect, call, clearContext, clearHTTPRequestHeaders, decryptResponseBody, enableServiceTiming, encryptRequestBody, encryptRequestBody, getDecryptingKey, getEncryptingKey, getEncryptingKeyInfo, getEncryptionAlgorithm, getHTTPRequestHeaders, getHTTPResponseHeader, getHTTPResponseHeaders, getKeyEncryptingKey, getKeyEncryptionAlgorithm, getLogOutput, getLogRawResponse, getMessageSecurity, getRequestSchemaValidation, getResponseSchemaValidation, getResponseValidity, getResponseValidityExceptionsAllowed, getServiceBeginTime, getServiceEndTime, getSigningCertificate, getSigningCertificateChain, getSigningPrivateKey, getSigningPublicKey, getSSLClientAuthentication, getSSLTrustVerification, getTrustVerifier, getUrl, isTransportPrivate, logRawResponse, logResponse, parseResponse, publishRequest, removeResponseEnvelope, schemaValidateRequest, schemaValidateResponse, send, setDecryptingKey, setEncryptingKey, setEncryptingKey, setEncryptingKeyInfo, setHTTPRequestHeader, setKeyEncryptingKey, setKeyEncryptingKey, setLogOutput, setLogRawResponse, setMessageSecurity, setRequestSchemaValidation, setResponseSchemaValidation, setResponseValidityExceptionsAllowed, setServerTrustPoints, setSigningCertificate, setSigningCertificateChain, setSigningPrivateKey, setSigningPublicKey, setSSLClientAuthentication, setSSLTrustVerification, setTrustVerifier, setUrl, signRequestBody, signRequestEnvelope, verifyResponseBody, verifyResponseEnvelope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlTransportDoc

public XmlTransportDoc(OutputStream logOutput)
Creates a transport for logging request messages.

Parameters:
logOutput - is an output stream to which the request will be written.
Method Detail

setStream

public void setStream(OutputStream logOutput)
Deprecated. please use AbstractTransport.setLogOutput(java.io.PrintStream).

Changes the output stream used to log request messages.

Parameters:
logOutput - is an output stream to which the request will be written.

logRequest

protected void logRequest(Document request,
                          PrintStream log)
Description copied from class: AbstractTransport
Writes the request message to the given output stream. AbstractTransport.sendRequest(org.apache.tsik.messaging.XmlRequest) calls this method if AbstractTransport.getLogOutput() returns a non-null output stream.

The default implementation of this method writes a global counter value, a line of dashes, and the pretty-printed XML of the message.

Overrides:
logRequest in class AbstractTransport
Parameters:
request - is the message to be logged, and includes the message envelope.
log - is stream to which to write the message. AbstractTransport.sendRequest(org.apache.tsik.messaging.XmlRequest) passes the value obtained from AbstractTransport.getLogOutput()

sendRequest

public XmlResponse sendRequest(XmlRequest req)
                        throws InsecureTransportException,
                               IOException,
                               XmlMessageException
Overrides the normal transport mechanism to log the request message and return null.

Specified by:
sendRequest in interface XmlTransport
Overrides:
sendRequest in class AbstractTransport
Parameters:
req - is the web service request object.
Returns:
always null.
Throws:
InsecureTransportException - TODO.
IOException - TODO.
XmlMessageException - TODO.