xmltooling  1.6.4
xmltooling::SOAPTransport Class Referenceabstract

Encapsulates a transport layer protocol for sending/receiving messages. More...

#include <xmltooling/soap/SOAPTransport.h>

Inheritance diagram for xmltooling::SOAPTransport:
xmltooling::HTTPSOAPTransport xmltooling::OpenSSLSOAPTransport

Classes

struct  Address
 A simple structure to capture SOAP addressing information. More...
 

Public Types

enum  transport_auth_t {
  transport_auth_none = 0, transport_auth_basic = 1, transport_auth_digest = 2, transport_auth_ntlm = 3,
  transport_auth_gss = 4
}
 Common types of transport authentication that may be supported.
 

Public Member Functions

virtual bool isConfidential () const =0
 Indicates whether transport provides confidentiality. More...
 
virtual bool setConnectTimeout (long timeout)=0
 Sets the connection timeout. More...
 
virtual bool setTimeout (long timeout)=0
 Sets the request timeout. More...
 
virtual bool setAuth (transport_auth_t authType, const char *username=0, const char *password=0)=0
 Sets a particular form of transport authentication and credentials. More...
 
virtual bool setVerifyHost (bool verify)=0
 Determines whether TLS/SSL connections include a check of the server's certificate against the expected hostname or address. More...
 
virtual bool setCredential (const Credential *credential=0)=0
 Supplies transport credentials. More...
 
virtual bool setTrustEngine (const X509TrustEngine *trustEngine=0, const CredentialResolver *credResolver=0, CredentialCriteria *criteria=0, bool mandatory=true)=0
 Provides an X509TrustEngine to the transport to authenticate the transport peer. More...
 
virtual bool setCacheTag (std::string *cacheTag=0)
 Installs (or clears) a pointer to an object used for cache management of the content being accessed. More...
 
virtual bool setProviderOption (const char *provider, const char *option, const char *value)
 Sets an implementation-specific transport provider option. More...
 
virtual void send (std::istream &in)=0
 Sends a stream of data over the transport. More...
 
virtual void send (std::istream *in=0)
 Sends an optional stream of data over the transport. More...
 
virtual std::istream & receive ()=0
 Returns reference to response stream. More...
 
virtual bool isAuthenticated () const =0
 Returns result of authenticating transport peer. More...
 
virtual std::string getContentType () const =0
 Returns the MIME type of the response, if any. More...
 
virtual long getStatusCode () const
 Returns the status code of the response. More...
 

Detailed Description

Encapsulates a transport layer protocol for sending/receiving messages.

Most of the methods are const, meaning they don't affect the transport layer until the data is sent.

Member Function Documentation

◆ getContentType()

virtual std::string xmltooling::SOAPTransport::getContentType ( ) const
pure virtual

Returns the MIME type of the response, if any.

Returns
MIME type of response, or an empty string

◆ getStatusCode()

virtual long xmltooling::SOAPTransport::getStatusCode ( ) const
virtual

Returns the status code of the response.

Returns
transport status code, or 0 if unknown

◆ isAuthenticated()

virtual bool xmltooling::SOAPTransport::isAuthenticated ( ) const
pure virtual

Returns result of authenticating transport peer.

Returns
true iff TrustEngine or other mechanism successfully authenticated the peer

◆ isConfidential()

virtual bool xmltooling::SOAPTransport::isConfidential ( ) const
pure virtual

Indicates whether transport provides confidentiality.

Returns
true iff transport layer provides confidentiality

◆ receive()

virtual std::istream& xmltooling::SOAPTransport::receive ( )
pure virtual

Returns reference to response stream.

The resulting stream must be checked directly to determine whether data is available.

Returns
reference to a stream containing the response, if any

◆ send() [1/2]

virtual void xmltooling::SOAPTransport::send ( std::istream &  in)
pure virtual

Sends a stream of data over the transport.

The function may return without having received any data, depending on the nature of the transport.

If the stream is empty, a request may be issued with no body if the transport supports that feature.

Parameters
ininput stream to send

◆ send() [2/2]

virtual void xmltooling::SOAPTransport::send ( std::istream *  in = 0)
virtual

Sends an optional stream of data over the transport.

The function may return without having received any data, depending on the nature of the transport.

If the parameter is omitted, a request may be issued with no body if the transport supports that feature.

Parameters
ininput stream to send

◆ setAuth()

virtual bool xmltooling::SOAPTransport::setAuth ( transport_auth_t  authType,
const char *  username = 0,
const char *  password = 0 
)
pure virtual

Sets a particular form of transport authentication and credentials.

Parameters
authTypetype of transport authentication to use
usernameusername for transport authentication
passwordsimple password/credential for transport authentication
Returns
true iff the transport supports the indicated form of authentication

◆ setCacheTag()

virtual bool xmltooling::SOAPTransport::setCacheTag ( std::string *  cacheTag = 0)
virtual

Installs (or clears) a pointer to an object used for cache management of the content being accessed.

The lifetime of the object must be longer than the lifetime of this object.

Parameters
cacheTagoptional pointer to string used for cache management

◆ setConnectTimeout()

virtual bool xmltooling::SOAPTransport::setConnectTimeout ( long  timeout)
pure virtual

Sets the connection timeout.

Parameters
timeouttime to wait for connection to server in seconds, or -1 for no timeout
Returns
true iff the transport supports connection timeouts

◆ setCredential()

virtual bool xmltooling::SOAPTransport::setCredential ( const Credential credential = 0)
pure virtual

Supplies transport credentials.

The lifetime of the credential must be longer than the lifetime of this object.

Parameters
credentiala Credential instance, or nullptr
Returns
true iff the transport supports the use of the Credential

◆ setProviderOption()

virtual bool xmltooling::SOAPTransport::setProviderOption ( const char *  provider,
const char *  option,
const char *  value 
)
virtual

Sets an implementation-specific transport provider option.

Requires knowledge of the underlying SOAPTransport implementation. Without the proper knowledge and inputs, crashes may result.

Parameters
providername of the SOAPTransport class the caller believes is in use
optionimplementation-specific string containing the option to set
valueimplementation- and option-specific string to use
Returns
true iff the transport supports the option and value supplied

◆ setTimeout()

virtual bool xmltooling::SOAPTransport::setTimeout ( long  timeout)
pure virtual

Sets the request timeout.

Parameters
timeouttime to wait for a response in seconds, or -1 for no timeout
Returns
true iff the transport supports request/response timeouts

◆ setTrustEngine()

virtual bool xmltooling::SOAPTransport::setTrustEngine ( const X509TrustEngine trustEngine = 0,
const CredentialResolver credResolver = 0,
CredentialCriteria criteria = 0,
bool  mandatory = true 
)
pure virtual

Provides an X509TrustEngine to the transport to authenticate the transport peer.

The lifetime of the engine must be longer than the lifetime of this object.

Parameters
trustEnginean X509TrustEngine instance, or nullptr
credResolvera CredentialResolver to supply the peer's trusted credentials, or nullptr
criteriaoptional criteria for selecting peer credentials
mandatoryflag controls whether message is sent at all if the transport isn't authenticated using the TrustEngine
Returns
true iff the transport supports the use of a TrustEngine

◆ setVerifyHost()

virtual bool xmltooling::SOAPTransport::setVerifyHost ( bool  verify)
pure virtual

Determines whether TLS/SSL connections include a check of the server's certificate against the expected hostname or address.

Defaults to true, and has no effect for insecure protocols.

Parameters
verifytrue iff the hostname should be verified against the server's certificate
Returns
true iff the transport supports hostname verification

The documentation for this class was generated from the following file: