CSenSoapEnvelope Class Reference

API published in: S60 3rd Ed

Link against: senutils.lib

Capability Information

Required Capabilities

NetworkServices ReadUserData WriteUserData


#include <sensoapenvelope.h>

Inherits CSenBaseFragment.

Inherited by CSenSoapMessage.


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.


Public Member Functions

virtual IMPORT_C  ~CSenSoapEnvelope ()
  Destructor.
virtual IMPORT_C TPtrC8  SetBodyL (const TDesC8 &aBody)
  Sets body of the envelope.
virtual IMPORT_C CSenElement BodyL ()
  Getter for envelopes body.
virtual IMPORT_C CSenElement HeaderL ()
  Getter for envelopes header.
virtual IMPORT_C CSenElement AddHeaderL (CSenElement &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 CSenSoapFault DetachFaultL ()
  Detaches the <Fault> element from the envelope, removing the element from the envelope.
virtual IMPORT_C CSenSoapFault FaultL ()
  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.

Static Public Member Functions

static IMPORT_C CSenSoapEnvelope NewL ()
  Two-phased constructor.

Protected Member Functions

  CSenSoapEnvelope ()
  Constructor.
IMPORT_C void  BaseConstructL ()
  This method should be called from the deriving classes ConstructL() methods.
virtual IMPORT_C void  ParseHeaderL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttributes)
  This method should be overridden by subclasses.
virtual IMPORT_C void  StartElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &aAttributes)
  Callback function which implement the XML content handler interface.
virtual IMPORT_C void  EndElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName)
  Callback function which implement the XML content handler interface.

Protected Attributes

CSenBaseFragment ipBodyFragment
CSenBaseFragment ipHeaderFragment
HBufC8 *  ipSoapAction

Constructor & Destructor Documentation

virtual IMPORT_C CSenSoapEnvelope::~CSenSoapEnvelope  )  [virtual]
 

Destructor.

CSenSoapEnvelope::CSenSoapEnvelope  )  [protected]
 

Constructor.


Member Function Documentation

virtual IMPORT_C CSenElement& CSenSoapEnvelope::AddHeaderL CSenElement aHeaderElement  )  [virtual]
 

Adds an element to the header.

Parameters:
aHeaderElement  new child element to be added inside Header element. Ownership is always transferred to CSenSoapEnvelope.
Returns:
added CSenElement
IMPORT_C void CSenSoapEnvelope::BaseConstructL  )  [protected]
 

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

Reimplemented in CSenSoapMessage.

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

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

Returns:
body as a HBufC8 pointer. Ownership is transferred to caller.
virtual IMPORT_C CSenElement& CSenSoapEnvelope::BodyL  )  [virtual]
 

Getter for envelopes body.

Returns:
body as CSenElement
virtual IMPORT_C CSenSoapFault* CSenSoapEnvelope::DetachFaultL  )  [virtual]
 

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

Returns:
pointer to the soap fault. Caller takes the ownership. NULL if <Fault> element is non-existent.
virtual IMPORT_C void CSenSoapEnvelope::EndElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName
[protected, virtual]
 

Callback function which implement the XML content handler interface.

This callback will occur on each end element tag found in the XML document.

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

Reimplemented from CSenBaseFragment.

virtual IMPORT_C CSenSoapFault* CSenSoapEnvelope::FaultL  )  [virtual]
 

Gets the <Fault> element.

Ownership is not transferred. NULL if not a fault.

Returns:
reference to SOAP fault object owned by this SOAP envelope
virtual IMPORT_C CSenElement& CSenSoapEnvelope::HeaderL  )  [virtual]
 

Getter for envelopes header.

Returns:
header as CSenElement
virtual IMPORT_C TBool CSenSoapEnvelope::IsFault  )  [virtual]
 

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

Returns:
TBool ETrue if there is a fault, EFalse if not.
static IMPORT_C CSenSoapEnvelope* CSenSoapEnvelope::NewL  )  [static]
 

Two-phased constructor.

Reimplemented in CSenSoapMessage.

virtual IMPORT_C void CSenSoapEnvelope::ParseHeaderL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
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.

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 CSenSoapMessage.

virtual IMPORT_C TPtrC8 CSenSoapEnvelope::SetBodyL const TDesC8 &  aBody  )  [virtual]
 

Sets body of the envelope.

Parameters:
aBody  Body (content) to be set.
Returns:
SOAP body (content) which was just set
virtual IMPORT_C TPtrC8 CSenSoapEnvelope::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.

Parameters:
aSoapAction  the SOAP Action HTTP header to be set. The default value is KSoapActionHeaderValueEmpty, 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 CSenSoapEnvelope::SoapAction  )  [virtual]
 

Gets the soap action header.

Returns:
current SOAP action header, which is always wrapped inside double quotation marks. The default empty value is "", as defined in KSoapActionHeaderValueEmpty.
virtual IMPORT_C void CSenSoapEnvelope::StartElementL const TDesC8 &  aNsUri,
const TDesC8 &  aLocalName,
const TDesC8 &  aQName,
const RAttributeArray &  aAttributes
[protected, virtual]
 

Callback function which implement the XML content handler interface.

This callback will occur on each start element tag found in the XML document. The SOAP envelope recognizes and parses the following elements and their corresponding attributes inside namespace defined in KSoapXmlns: KEnvelopeName, "Envelope" KHeaderName, "Header" KBodyName, "Body" KFault, "Fault" (only if found inside Body element)

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 from CSenBaseFragment.


Field Documentation

CSenBaseFragment* CSenSoapEnvelope::ipBodyFragment [protected]
 
CSenBaseFragment* CSenSoapEnvelope::ipHeaderFragment [protected]
 
HBufC8* CSenSoapEnvelope::ipSoapAction [protected]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top