CSenSoapEnvelope2 Class Reference

Link against: senmessages.lib


#include <
SenSoapEnvelope2.h>

Inherits CSenFragmentBase, and MSenMessage.

Inherited by CSenSoapMessage2.


Detailed Description

CSenSoapEnvelope is an utility class offering capability to parse XML SOAP envelope and manipulation methods to alter its contents.

Typically WSC uses this class to parse messages received through WSF HandleMessageL() and HandleErrorL() callbacks. Class has convenience methods for checking if a SOAP envelope body contains a fault and functionality to detach SOAP Fault object out from it. Also possibility to set SOAPAction HTTP header is supported.

Dll SenUtils.lib
Since:
Series60 4.0

Public Member Functions

virtual IMPORT_C ~CSenSoapEnvelope2 ()
 Destructor.
virtual IMPORT_C TPtrC8 SetBodyL (const TDesC8 &aBody)
 Sets body of the envelope.
virtual IMPORT_C TXmlEngElement SetBodyL (TXmlEngElement aBodyElement)
 Sets body of the envelope.
virtual IMPORT_C TXmlEngElement BodyL ()
 Getter for envelopes body.
virtual IMPORT_C TXmlEngElement HeaderL ()
 Getter for envelopes header.
virtual IMPORT_C TXmlEngElement AddHeaderL (TXmlEngElement aHeaderElement)
 Adds an element to the header.
virtual IMPORT_C HBufC8 * BodyAsStringL ()
 Getter for the envelope body as a UTF-8 form XML string.
virtual IMPORT_C TBool IsFault ()
 Checks if this SOAP envelope body contains SOAP fault or not.
virtual IMPORT_C CSenSoapFault2DetachFaultL ()
 Detaches the <Fault> element from the envelope, removing the element from the envelope.
virtual IMPORT_C CSenSoapFault2FaultL ()
 Gets the <Fault> element.
virtual IMPORT_C TPtrC8 SetSoapActionL (const TDesC8 &aSoapAction)
 Sets the SOAP action HTTP header.
virtual IMPORT_C TPtrC8 SoapAction ()
 Gets the soap action header.
IMPORT_C TBool HasHeader ()
IMPORT_C TBool HasBody ()
virtual IMPORT_C TSOAPVersion SoapVersion ()
 Getter for currently effecitve SOAP version.
virtual IMPORT_C TClass Type ()
 Gets the Message Type.
virtual IMPORT_C TDirection Direction ()
 Gets the Message Direction.
virtual IMPORT_C TInt SetContext (MSenMessageContext *apOwnedContext)
 Sets message context for this message.
virtual IMPORT_C MSenMessageContext * Context ()
 Getter for message's context.
virtual IMPORT_C TInt SetProperties (MSenProperties *apOwnedProperties)
 Sets properties for this message.
virtual IMPORT_C MSenPropertiesProperties ()
 Getter for message specific (transport) properties.
virtual IMPORT_C TBool IsSafeToCast (TClass aType)
virtual IMPORT_C TInt TxnId ()
 Getter for transaction ID of this message.
virtual IMPORT_C MSenMessageCloneL ()
 Clone method that duplicates this message -- including all member data in the message.

Static Public Member Functions

static IMPORT_C CSenSoapEnvelope2NewL ()
 Two-phased constructor.
static IMPORT_C CSenSoapEnvelope2NewLC ()
 Two-phased constructor.
static IMPORT_C CSenSoapEnvelope2NewL (MSenMessageContext &aContext)
 Two-phased constructor.
static IMPORT_C CSenSoapEnvelope2NewLC (MSenMessageContext &aContext)
 Two-phased constructor.
static IMPORT_C CSenSoapEnvelope2NewL (CSenSoapEnvelope2 &aEnvelope)
 Two-phased copy constructor.
static IMPORT_C CSenSoapEnvelope2NewLC (CSenSoapEnvelope2 &aEnvelope)
 Two-phased copy constructor.

Protected Member Functions

 CSenSoapEnvelope2 ()
 Constructor.
IMPORT_C void BaseConstructL (TSOAPVersion aVersion)
 This method should be called from the deriving classes ConstructL() methods.
IMPORT_C void BaseConstructL ()
 This method should be called from the deriving classes ConstructL() methods.
IMPORT_C void BaseConstructL (MSenMessageContext &aMessage)
 This method should be called from the deriving classes ConstructL() methods.
IMPORT_C void BaseConstructL (MSenMessageContext &aMessage, TSOAPVersion aVersion)
 This method should be called from the deriving classes ConstructL() methods.
IMPORT_C void BaseConstructL (CSenSoapEnvelope2 &aEnvelope)
 This method should be called from the deriving classes ConstructL() methods.
virtual IMPORT_C void ParseHeaderL (const RTagInfo &aElement, const RAttributeArray &aAttributes)
 This method should be overridden by subclasses.
virtual IMPORT_C void OnStartElementL (const RTagInfo &aElement, const RAttributeArray &aAttributes, TInt aErrorCode)
 Callback function implementing the XML content handler interface.
virtual IMPORT_C void OnEndElementL (const RTagInfo &aElement, TInt aErrorCode)
 Callback function implementing the XML content handler interface.
virtual IMPORT_C CSenFragmentBaseCreateBodyFragmentL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aPrefix, const RAttributeArray &aAttributes, TXmlEngElement &aParent, RSenDocument &aOwnerDocument)

Protected Attributes

CSenFragmentBaseipBodyFragment
CSenFragmentBaseipHeaderFragment
HBufC8 * ipSoapAction
TInt iTransactionId
MSenPropertiesipProperties
MSenMessageContext * ipNotOwnedContext
TAny * ipReserved
TBool iFault
TDirection iDirection

Constructor & Destructor Documentation

virtual IMPORT_C CSenSoapEnvelope2::~CSenSoapEnvelope2  )  [virtual]
 

Destructor.

CSenSoapEnvelope2::CSenSoapEnvelope2  )  [protected]
 

Constructor.


Member Function Documentation

virtual IMPORT_C TXmlEngElement CSenSoapEnvelope2::AddHeaderL TXmlEngElement  aHeaderElement  )  [virtual]
 

Adds an element to the header.

Since:
Series60 4.0
Parameters:
aHeaderElement new child element to be added inside Header element. Ownership is always transferred to CSenSoapEnvelope.
Returns:
added TXmlEngElement
IMPORT_C void CSenSoapEnvelope2::BaseConstructL CSenSoapEnvelope2 aEnvelope  )  [protected]
 

This method should be called from the deriving classes ConstructL() methods.

Since:
Series60 4.0
IMPORT_C void CSenSoapEnvelope2::BaseConstructL MSenMessageContext &  aMessage,
TSOAPVersion  aVersion
[protected]
 

This method should be called from the deriving classes ConstructL() methods.

Since:
Series60 4.0

Reimplemented in CSenSoapMessage2.

IMPORT_C void CSenSoapEnvelope2::BaseConstructL MSenMessageContext &  aMessage  )  [protected]
 

This method should be called from the deriving classes ConstructL() methods.

Since:
Series60 4.0

Reimplemented in CSenSoapMessage2.

IMPORT_C void CSenSoapEnvelope2::BaseConstructL  )  [protected]
 

This method should be called from the deriving classes ConstructL() methods.

Since:
Series60 4.0

Reimplemented in CSenSoapMessage2.

IMPORT_C void CSenSoapEnvelope2::BaseConstructL TSOAPVersion  aVersion  )  [protected]
 

This method should be called from the deriving classes ConstructL() methods.

Since:
Series60 4.0

Reimplemented in CSenSoapMessage2.

virtual IMPORT_C HBufC8* CSenSoapEnvelope2::BodyAsStringL  )  [virtual]
 

Getter for the envelope body as a UTF-8 form XML string.

Since:
Series60 4.0
Returns:
body as a HBufC8 pointer. Ownership is transferred to caller.
virtual IMPORT_C TXmlEngElement CSenSoapEnvelope2::BodyL  )  [virtual]
 

Getter for envelopes body.

Since:
Series60 4.0
Returns:
body as TXmlEngElement
virtual IMPORT_C MSenMessage* CSenSoapEnvelope2::CloneL  )  [virtual]
 

Clone method that duplicates this message -- including all member data in the message.

For the service consumers, a typical use case for cloning the message is when there is need to preserve the received response beyond the life time of a transaction. Normally, the response messages, that are owned by service connection are de-allocated after execution returns from MSenServiceConsumer interface's HandleMessageL or HandleErrorL method, back to the service connection.

Returns:
a pointer to a new message class instance, which ownership IS transferred to a caller. Note that caller is expected to cast this pointer to a proper subclass via the use of IsSafeToCast method. In case of responses, the message type is normally equal with the type of the request message that was sent by the consumer.

Implements MSenMessage.

Reimplemented in CSenSoapMessage2.

virtual IMPORT_C MSenMessageContext* CSenSoapEnvelope2::Context  )  [virtual]
 

Getter for message's context.

Returns:
message context, if this message relates to (has associated with) such context, or NULL.

Implements MSenMessage.

virtual IMPORT_C CSenFragmentBase* CSenSoapEnvelope2::CreateBodyFragmentL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aPrefix,
const RAttributeArray aAttributes,
TXmlEngElement aParent,
RSenDocument aOwnerDocument
[protected, virtual]
 
virtual IMPORT_C CSenSoapFault2* CSenSoapEnvelope2::DetachFaultL  )  [virtual]
 

Detaches the <Fault> element from the envelope, removing the element from the envelope.

Since:
Series60 4.0
Returns:
pointer to the soap fault. Caller takes the ownership. NULL if <Fault> element is non-existent.
virtual IMPORT_C TDirection CSenSoapEnvelope2::Direction  )  [virtual]
 

Gets the Message Direction.

Implements MSenMessage.

virtual IMPORT_C CSenSoapFault2* CSenSoapEnvelope2::FaultL  )  [virtual]
 

Gets the <Fault> element.

Ownership is not transferred. NULL if not a fault.

Since:
Series60 4.0
Returns:
reference to SOAP fault object owned by this SOAP envelope
IMPORT_C TBool CSenSoapEnvelope2::HasBody  ) 
 
IMPORT_C TBool CSenSoapEnvelope2::HasHeader  ) 
 
virtual IMPORT_C TXmlEngElement CSenSoapEnvelope2::HeaderL  )  [virtual]
 

Getter for envelopes header.

Since:
Series60 4.0
Returns:
header as TXmlEngElement
virtual IMPORT_C TBool CSenSoapEnvelope2::IsFault  )  [virtual]
 

Checks if this SOAP envelope body contains SOAP fault or not.

Since:
Series60 4.0
Returns:
TBool ETrue if there is a fault, EFalse if not.
virtual IMPORT_C TBool CSenSoapEnvelope2::IsSafeToCast TClass  aType  )  [virtual]
 
static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL CSenSoapEnvelope2 aEnvelope  )  [static]
 

Two-phased copy constructor.

static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL MSenMessageContext &  aContext  )  [static]
 

Two-phased constructor.

Reimplemented in CSenSoapMessage2.

static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewL  )  [static]
 

Two-phased constructor.

Reimplemented in CSenSoapMessage2.

static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC CSenSoapEnvelope2 aEnvelope  )  [static]
 

Two-phased copy constructor.

static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC MSenMessageContext &  aContext  )  [static]
 

Two-phased constructor.

Reimplemented in CSenSoapMessage2.

static IMPORT_C CSenSoapEnvelope2* CSenSoapEnvelope2::NewLC  )  [static]
 

Two-phased constructor.

Reimplemented in CSenSoapMessage2.

virtual IMPORT_C void CSenSoapEnvelope2::OnEndElementL const RTagInfo &  aElement,
TInt  aErrorCode
[protected, virtual]
 

Callback function implementing the XML content handler interface.

Inheriting classes can override these.

Since:
Series60 3.1
See also:
MContentHandler

Reimplemented from CSenFragmentBase.

virtual IMPORT_C void CSenSoapEnvelope2::OnStartElementL const RTagInfo &  aElement,
const RAttributeArray aAttributes,
TInt  aErrorCode
[protected, virtual]
 

Callback function implementing the XML content handler interface.

Inheriting classes can override these.

Since:
Series60 3.1
See also:
MContentHandler

Reimplemented from CSenFragmentBase.

virtual IMPORT_C void CSenSoapEnvelope2::ParseHeaderL const RTagInfo &  aElement,
const RAttributeArray aAttributes
[protected, virtual]
 

This method should be overridden by subclasses.

Implements functionality to parse SOAP header if one is found during parsing the envelope. Parses all elements found under top <Header> element by using DOM fragment.

Since:
Series60 4.0
Parameters:
aNsUri The namespace URI of the new element
aLocalName The local name of the new element
aQName The qualified name of the new element
aAttributes The attributes of the new element

Reimplemented in CSenSoapMessage2.

virtual IMPORT_C MSenProperties* CSenSoapEnvelope2::Properties  )  [virtual]
 

Getter for message specific (transport) properties.

Returns:
(transport) properties of this message, if such have been applied to this message or NULL otherwise.

Implements MSenMessage.

virtual IMPORT_C TXmlEngElement CSenSoapEnvelope2::SetBodyL TXmlEngElement  aBodyElement  )  [virtual]
 

Sets body of the envelope.

Since:
Series60 4.0
Parameters:
aBody Body (content) to be set.
Returns:
SOAP body (content) which was just set
virtual IMPORT_C TPtrC8 CSenSoapEnvelope2::SetBodyL const TDesC8 &  aBody  )  [virtual]
 

Sets body of the envelope.

Since:
Series60 4.0
Parameters:
aBody Body (content) to be set.
Returns:
SOAP body (content) which was just set
virtual IMPORT_C TInt CSenSoapEnvelope2::SetContext MSenMessageContext *  apOwnedContext  )  [virtual]
 

Sets message context for this message.

If context already exists, it is discarded and replaced by this context (context reset is performed).

Parameters:
apNotOwnedContext is the context. Ownership is NOT transferred to this message.
Returns:
KErrNone on success KErrArgument if apOwnedContext == NULL or system-wide errorcode otherwise.

Implements MSenMessage.

virtual IMPORT_C TInt CSenSoapEnvelope2::SetProperties MSenProperties apOwnedProperties  )  [virtual]
 

Sets properties for this message.

Most typical use case is to set message spesific transport properties.

Parameters:
apOwnedProperties pointer to the properties, which ownership is transferred to this class. This is performed in two different manners:
1. If message has context, the properties are (re)set into that context, discarding any pre-existing properties.

2. If context is NOT available, properties will be directly owned by this message.

Returns:
KErrNone on success KErrArgument if apOwnedProperties == NULL or system-wide errorcode otherwise.

Implements MSenMessage.

virtual IMPORT_C TPtrC8 CSenSoapEnvelope2::SetSoapActionL const TDesC8 &  aSoapAction  )  [virtual]
 

Sets the SOAP action HTTP header.

WSF will use this value while submitting this SOAP envelope request over HTTP/S transport.

Since:
Series60 4.0
Parameters:
aSoapAction the SOAP Action HTTP header to be set. The default value is KSenSoapActionHeaderValueEmpty, which is two double quotation marks - "" - without any character in between. SOAP specification requires double quotation marks, even if action is empty. If a string without double quotation marks is passed, it will be wrapped inside double quotation marks, added in the beginning and at the end of the actual SOAP Action string.
Returns:
newly set SOAP action header. String might have been extended to include double quotation marks, if those were missing from the argument.
virtual IMPORT_C TPtrC8 CSenSoapEnvelope2::SoapAction  )  [virtual]
 

Gets the soap action header.

Since:
Series60 4.0
Returns:
current SOAP action header, which is always wrapped inside double quotation marks. If SOAPAction has not been set to this SOAP envelope instance, function will return zero-length descriptor (KNullDesC8)
virtual IMPORT_C TSOAPVersion CSenSoapEnvelope2::SoapVersion  )  [virtual]
 

Getter for currently effecitve SOAP version.

Returns:
enumeration which dictates SOAP version.
virtual IMPORT_C TInt CSenSoapEnvelope2::TxnId  )  [virtual]
 

Getter for transaction ID of this message.

In case of receiving a response message from service provider, this transaction ID may be used to map the response with request that the service consumer sent via service connection. In such case, the consumer can store return value from SendL method that was invoked in order maintain this mapping.

Returns:
the transaction ID of this message

Implements MSenMessage.

virtual IMPORT_C TClass CSenSoapEnvelope2::Type  )  [virtual]
 

Gets the Message Type.

Implements MSenMessage.

Reimplemented in CSenSoapMessage2.


Field Documentation

TDirection CSenSoapEnvelope2::iDirection [protected]
 
TBool CSenSoapEnvelope2::iFault [protected]
 
CSenFragmentBase* CSenSoapEnvelope2::ipBodyFragment [protected]
 
CSenFragmentBase* CSenSoapEnvelope2::ipHeaderFragment [protected]
 
MSenMessageContext* CSenSoapEnvelope2::ipNotOwnedContext [protected]
 
MSenProperties* CSenSoapEnvelope2::ipProperties [protected]
 
TAny* CSenSoapEnvelope2::ipReserved [protected]
 
HBufC8* CSenSoapEnvelope2::ipSoapAction [protected]
 
TInt CSenSoapEnvelope2::iTransactionId [protected]
 

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

Copyright © Nokia Corporation 2001-2007
Back to top