Poco::RemotingNG::SOAP

class Transport

File Information

Library: RemotingNG/SOAP
Package: SOAP
Header: Poco/RemotingNG/SOAP/Transport.h

Description

The Transport implementation for RemotingNG SOAP.

The transport supports HTTP Basic and HTTP Digest authentication. Please note that for HTTP Digest authentication to work, chunked transfer encoding must be disabled. Also, HTTP Digest authentication is not supported for one-way requests.

Inheritance

Direct Base Classes: Poco::RemotingNG::Transport

All Base Classes: Poco::RefCountedObject, Poco::RemotingNG::AttributedObject, Poco::RemotingNG::Transport

Member Summary

Member Functions: addRequestHeaderInterceptor, addResponseHeaderInterceptor, beginMessage, beginRequest, connect, connected, disconnect, enableChunkedTransferEncoding, enableCompression, enableKeepAlive, enableMTOM, endPoint, endRequest, getAuthentication, getCookieStore, getCredentials, getCustomHeader, getKeepAliveTimeout, getPassword, getProxyConfig, getSerializerOptions, getTimeout, getUserAgent, getUsername, hasCustomHeader, httpSessionFactory, isChunkedTransferEncodingEnabled, isCompressionEnabled, isKeepAliveEnabled, isMTOMEnabled, prepareRequest, removeCustomHeader, removeRequestHeaderInterceptor, removeResponseHeaderInterceptor, requireSession, sendMessage, sendRequest, setAuthentication, setCookieStore, setCredentials, setCustomHeader, setKeepAliveTimeout, setPassword, setProxyConfig, setSerializerOptions, setTimeout, setUserAgent, setUsername

Inherited Functions: beginMessage, beginRequest, clearAttributes, connect, connected, countAttributes, disconnect, duplicate, endPoint, endRequest, enumerateAttributes, getAttribute, hasAttribute, lock, operator =, referenceCount, release, removeAttribute, sendMessage, sendRequest, setAttribute, unlock

Types Aliases

RequestHeaderInterceptor

using RequestHeaderInterceptor = Serializer::HeaderInterceptor;

ResponseHeaderInterceptor

using ResponseHeaderInterceptor = Deserializer::HeaderInterceptor;

Enumerations

AuthMode

Authentication mode.

AUTH_NONE = 0

No authentication.

AUTH_BASIC = 1

HTTP Basic Authentication only (credentials are always sent).

AUTH_DIGEST = 2

HTTP Digest Authentication only.

AUTH_ANY = 3

HTTP Basic or Digest authentication (whichever the server requests).

AUTH_WSSE_TEXT = 4

WS-Security Username Token Profile with plaintext password

AUTH_WSSE_DIGEST = 5

WS-Security Username Token Profile with password digest

Constructors

Transport

Transport();

Creates a Transport for SOAP 1.1.

Transport

Transport(
    Serializer::SOAPVersion soapVersion
);

Creates a Transport for the given SOAP version.

Destructor

~Transport virtual

~Transport();

Destroys the Transport.

Member Functions

addRequestHeaderInterceptor

void addRequestHeaderInterceptor(
    RequestHeaderInterceptor::Ptr pInterceptor
);

Adds a header interceptor to the request serializer.

addResponseHeaderInterceptor

void addResponseHeaderInterceptor(
    ResponseHeaderInterceptor::Ptr pInterceptor
);

Adds a header interceptor to the response deserializer.

beginMessage

Poco::RemotingNG::Serializer & beginMessage(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    const Poco::RemotingNG::Identifiable::TypeId & tid,
    const std::string & messageName,
    Poco::RemotingNG::SerializerBase::MessageType messageType
);

beginRequest

Poco::RemotingNG::Serializer & beginRequest(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    const Poco::RemotingNG::Identifiable::TypeId & tid,
    const std::string & messageName,
    Poco::RemotingNG::SerializerBase::MessageType messageType
);

connect virtual

void connect(
    const std::string & endPoint
);

connected virtual

bool connected() const;

disconnect virtual

void disconnect();

enableChunkedTransferEncoding

void enableChunkedTransferEncoding(
    bool enable = true
);

Enables or disables chunked transfer encoding for HTTP requests. This is normally enabled. However, some poorly implemented HTTP stacks cannot handle chunked HTTP messages. Also, chunked transfer encoding must be disabled if AUTH_DIGEST or AUTH_ANY authentication is used.

Regardless of this setting, chunked transfer encoding is always supported for responses sent by the server.

enableCompression

void enableCompression(
    bool enable
);

Enables or disables HTTP compression via GZIP Content-Encoding for requests. This is normally disabled, due to a lack of support by most servers.

Note that chunked transfer encoding must also be enabled in order to allow compression.

Regardless of this setting, server responses can always be compressed using GZIP Content-Encoding.

enableKeepAlive

void enableKeepAlive(
    bool enable
);

Enables or disables HTTP/1.1 persistent connections.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

enableMTOM

void enableMTOM(
    bool enable
);

Enables or disables MTOM (Message Transport Optimization Mechanism) for client requests. If enabled, every request will be sent in a MIME multipart message and binary data (std::vector<char>) will be sent raw in a separate MIME part instead of Base64-encoded within the SOAP body.

See http://www.w3.org/TR/soap12-mtom/ for more information about MTOM.

Regardless of this setting, server responses can always use MTOM.

endPoint virtual

const std::string & endPoint() const;

endRequest virtual

void endRequest();

getAuthentication

AuthMode getAuthentication() const;

Returns the authentication mode.

getCookieStore

CookieStore::Ptr getCookieStore() const;

Returns the CookieStore.

getCredentials

Credentials getCredentials() const;

Returns the credentials, containing username and password attributes.

getCustomHeader

const std::string & getCustomHeader(
    const std::string & name
) const;

Returns the value of the custom HTTP header with the given name.

Throws a Poco::NotFoundException if the custom header with the given name does not exist.

getKeepAliveTimeout

Poco::Timespan getKeepAliveTimeout() const;

Returns the timeout for HTTP/1.1 persistent connections.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

getPassword

const std::string & getPassword() const;

Deprecated. This function issc_deprecated.

Returns the password for HTTP authentication.

This method is deprecated and may be removed in a future version. Code should be changed to use getCredentials() instead.

getProxyConfig

const Poco::Net::HTTPClientSession::ProxyConfig & getProxyConfig() const;

Returns the proxy configuration.

getSerializerOptions inline

int getSerializerOptions() const;

Returns the specified serializer options.

getTimeout

Poco::Timespan getTimeout() const;

Returns the HTTP timeout.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

getUserAgent

const std::string & getUserAgent() const;

Returns the value of the User-Agent header sent with SOAP HTTP requests, or an empty string if no User-Agent value has been set.

getUsername

const std::string & getUsername() const;

Deprecated. This function issc_deprecated.

Returns the username for HTTP authentication.

This method is deprecated and may be removed in a future version. Code should be changed to use getCredentials() instead.

hasCustomHeader

bool hasCustomHeader(
    const std::string & name
) const;

Returns true if a custom HTTP header with the given name has been set.

httpSessionFactory static inline

static Poco::Net::HTTPSessionFactory & httpSessionFactory();

Returns the Poco::Net::HTTPSessionFactory instance used by the transport.

isChunkedTransferEncodingEnabled

bool isChunkedTransferEncodingEnabled() const;

Returns true iff chunked transfer encoding is enabled, which is the default unless enableChunkedTransferEncoding(false) has been called.

isCompressionEnabled

bool isCompressionEnabled() const;

Returns true iff HTTP compression (GZIP) is enabled for requests. Default is disabled.

isKeepAliveEnabled

bool isKeepAliveEnabled() const;

Returns true iff HTTP/1.1 persistent connections are enabled.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

isMTOMEnabled

bool isMTOMEnabled() const;

Returns true if MTOM (Message Transport Optimization Mechanism) is enabled for requests.

removeCustomHeader

void removeCustomHeader(
    const std::string & name
);

Removes a custom HTTP header previously added with setCustomHeader().

removeRequestHeaderInterceptor

void removeRequestHeaderInterceptor(
    RequestHeaderInterceptor::Ptr pInterceptor
);

Removes a header interceptor from the request serializer.

removeResponseHeaderInterceptor

void removeResponseHeaderInterceptor(
    ResponseHeaderInterceptor::Ptr pInterceptor
);

Removes a header interceptor from the response deserializer.

sendMessage

void sendMessage(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    const Poco::RemotingNG::Identifiable::TypeId & tid,
    const std::string & messageName,
    Poco::RemotingNG::SerializerBase::MessageType messageType
);

sendRequest

Poco::RemotingNG::Deserializer & sendRequest(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    const Poco::RemotingNG::Identifiable::TypeId & tid,
    const std::string & messageName,
    Poco::RemotingNG::SerializerBase::MessageType messageType
);

setAuthentication

void setAuthentication(
    AuthMode authMode
);

Sets the authentication mode.

Please note that for AUTH_DIGEST or AUTH_ANY, chunked transfer encoding must be disabled.

setCookieStore

void setCookieStore(
    CookieStore::Ptr pCookieStore
);

Sets the CookieStore.

setCredentials

void setCredentials(
    const Credentials & creds
);

Sets the credentials for client authentication.

The Credentials object should contain a username (Credentials::ATTR_USERNAME, "n") and a password (Credentials::ATTR_PASSWORD, "p") attribute.

setCustomHeader

void setCustomHeader(
    const std::string & name,
    const std::string & value
);

Adds a custom HTTP header to the HTTP request.

setKeepAliveTimeout

void setKeepAliveTimeout(
    const Poco::Timespan & timeout
);

Sets the timeout for HTTP/1.1 persistent connections.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

setPassword

void setPassword(
    const std::string & password
);

Deprecated. This function issc_deprecated.

Sets the password for HTTP authentication.

This method is deprecated and may be removed in a future version. Code should be changed to use setCredentials() instead.

setProxyConfig

void setProxyConfig(
    const Poco::Net::HTTPClientSession::ProxyConfig & proxyConfig
);

Sets the proxy configuration.

setSerializerOptions

void setSerializerOptions(
    int options
);

Sets the options for SOAP/XML serialization. See the Serializer class for supported option flags.

setTimeout

void setTimeout(
    const Poco::Timespan & timeout
);

Sets the HTTP timeout.

The Transport must be connected, otherwise a Poco::IllegalStateException will be thrown.

setUserAgent

void setUserAgent(
    const std::string & userAgent
);

Sets the value of the User-Agent header sent with SOAP HTTP requests. If an empty string is given (default), no User-Agent header is included in the request.

setUsername

void setUsername(
    const std::string & username
);

Deprecated. This function issc_deprecated.

Sets the username for HTTP authentication.

This method is deprecated and may be removed in a future version. Code should be changed to use setCredentials() instead.

prepareRequest protected

void prepareRequest(
    Poco::Net::HTTPRequest & request,
    const std::string & messageName
);

requireSession protected

const Poco::Net::HTTPClientSession & requireSession() const;

requireSession protected

Poco::Net::HTTPClientSession & requireSession();

Variables

CONTENT_TYPE_SOAP11 static

static const std::string CONTENT_TYPE_SOAP11;

CONTENT_TYPE_SOAP12 static

static const std::string CONTENT_TYPE_SOAP12;

PROTOCOL static

static const std::string PROTOCOL;

PROTOCOL_SOAP11 static

static const std::string PROTOCOL_SOAP11;

PROTOCOL_SOAP12 static

static const std::string PROTOCOL_SOAP12;

PROP_ACTION protected static

static const std::string PROP_ACTION;

SOAPACTION protected static

static const std::string SOAPACTION;

USER_AGENT protected static

static const std::string USER_AGENT;

Securely control IoT edge devices from anywhere   Connect a Device