Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

base_soap::SOAPRequest Class Reference

A soap request. More...

#include <libppbase/base_soap/SOAPRequest.h>

Inheritance diagram for base_soap::SOAPRequest:
base_soap::SOAPStruct base_soap::SOAPResponse

List of all members.

Public Types

enum  { contextUnknown = 0, contextUser = 1, contextSupport = 2, contextSystem = 4 }
 

Contexts.

More...

Public Member Functions

 SOAPRequest (const SOAPRequest &request)
 Copy constructor.
 SOAPRequest (xercesc::DOMImplementation *implementation, xercesc::DOMBuilder *parser, xercesc::DOMDocument *document)
 Constructor that creates a request on the server side (and response on the client side).
 SOAPRequest (const base::String &classname, const base::String &method, const base::String &instance="")
 Constructor that creates a request on the client side.
 SOAPRequest (const base::String &classname, const base::String &method, int instance)
 Constructor that creates a request on the client side.
 ~SOAPRequest ()
 Destructor.
void addAttachment (SOAPAttachment *attachment, bool own=false)
 Adds an attachment.
SOAPResponse * createResponse ()
 Creates a response object for this request.
SOAPResponse * createResponse (const SOAPException &excp)
 Creates a response object for this request, containing an exception.
SOAPAttachment * getAttachment (const base::String &id, bool throwex=true) const
 Gets an attachment.
std::vector< SOAPAttachment * > getAttachments () const
 Gets all attachments.
base::String getClass () const
 Gets the class name of this soap request.
int getContext () const
 Gets the context of this soap request.
base::String getInstance () const
 Gets the instance of this soap request.
base::String getMethod () const
 Gets the method of this soap request.
base::String getProgram () const
 Gets the calling program name.
base::String getQName (const base::String &name) const
 Gets the qualified name for a local node name (prepends prefix).
base::String getRemoteAddr () const
 Gets the calling remote (ip) address.
SOAPResponse * getResponse () const
 Returns the internal response object.
int getUserId () const
 Gets the calling user id of this soap request.
base::String getUserName () const
 Gets the calling user name.
void setClass (const base::String &classname)
 Set (change) class name.
void setContext (int context)
 Set (change) context.
void setInstance (const base::String &instance)
 Set (change) instance.
void setMethod (const base::String &method)
 Set (change) method name.
void setProgram (const base::String &program)
 Set (change) calling program name.
void setRemoteAddr (const base::String &addr)
 Set (change) calling remote (ip) address.
void setResponse (SOAPResponse *response)
 Set the response.
void setUserId (int userid)
 Set (change) calling user id.
void setUserName (const base::String &username)
 Set (change) calling user name.
void toXML (xercesc::MemBufFormatTarget *target) const
 Serializes this request into xml.
base::String toXML () const
 Returns xml representation of this request.

Protected Member Functions

void constructor (const base::String &classname, const base::String &method, const base::String &instance)
 Constructor helper.

Protected Attributes

std::vector< SOAPAttachment * > _attachments
 Attachment list.
xercesc::DOMElement * _header
 The soap header.
xercesc::DOMImplementation * _implementation
 The dom implementation.
std::vector< bool > _own
 Attachment ownership.
xercesc::DOMBuilder * _parser
 The parser that owns the dom document.
base::String _prefix
 Namespace prefix.
SOAPResponse * _response
 The response to this request.

Detailed Description

A soap request.

Author:
Christoph Schwarz
Version:
Id:
SOAPRequest.h 21 2010-09-05 04:18:17Z cschwarz1

Member Enumeration Documentation

anonymous enum

Contexts.

Enumerator:
contextUnknown 

unknown context

contextUser 

user context

contextSupport 

support context

contextSystem 

system context


Constructor & Destructor Documentation

base_soap::SOAPRequest::SOAPRequest ( const SOAPRequest &  request  ) 

Copy constructor.

Parameters:
request the request to copy
base_soap::SOAPRequest::SOAPRequest ( xercesc::DOMImplementation *  implementation,
xercesc::DOMBuilder *  parser,
xercesc::DOMDocument *  document 
)

Constructor that creates a request on the server side (and response on the client side).

Parameters:
implementation a dom implementation
parser a dom parser
document the document parsed and owned by the parser
base_soap::SOAPRequest::SOAPRequest ( const base::String &  classname,
const base::String &  method,
const base::String &  instance = "" 
)

Constructor that creates a request on the client side.

Parameters:
classname class to call
method method to call
instance instance to use
base_soap::SOAPRequest::SOAPRequest ( const base::String &  classname,
const base::String &  method,
int  instance 
)

Constructor that creates a request on the client side.

Parameters:
classname class to call
method method to call
instance instance to use

Member Function Documentation

void base_soap::SOAPRequest::addAttachment ( SOAPAttachment *  attachment,
bool  own = false 
)

Adds an attachment.

Parameters:
attachment the attachment to add
own ownership flag
void base_soap::SOAPRequest::constructor ( const base::String &  classname,
const base::String &  method,
const base::String &  instance 
) [protected]

Constructor helper.

Parameters:
classname class to call
method method to call
instance instance to use
SOAPResponse* base_soap::SOAPRequest::createResponse (  ) 

Creates a response object for this request.

Returns:
the response object, the caller must not delete it
SOAPResponse* base_soap::SOAPRequest::createResponse ( const SOAPException &  excp  ) 

Creates a response object for this request, containing an exception.

Parameters:
excp the exception
Returns:
the respomse object, the caller must not delete it
SOAPAttachment* base_soap::SOAPRequest::getAttachment ( const base::String &  id,
bool  throwex = true 
) const

Gets an attachment.

Parameters:
id the attachment id
throwex true to throw an exception if the attachment does not exist, false to return NULL
Returns:
the attachment or NULL if the attachment does not exist and throwex is false
std::vector<SOAPAttachment*> base_soap::SOAPRequest::getAttachments (  )  const

Gets all attachments.

Returns:
the attachments
base::String base_soap::SOAPRequest::getClass (  )  const

Gets the class name of this soap request.

Returns:
the class name
int base_soap::SOAPRequest::getContext (  )  const

Gets the context of this soap request.

Returns:
the context
base::String base_soap::SOAPRequest::getInstance (  )  const

Gets the instance of this soap request.

Returns:
the instance
base::String base_soap::SOAPRequest::getMethod (  )  const

Gets the method of this soap request.

Returns:
the method name
base::String base_soap::SOAPRequest::getProgram (  )  const

Gets the calling program name.

Returns:
the calling program name
base::String base_soap::SOAPRequest::getQName ( const base::String &  name  )  const

Gets the qualified name for a local node name (prepends prefix).

Parameters:
name the local name
Returns:
the qualified name
base::String base_soap::SOAPRequest::getRemoteAddr (  )  const

Gets the calling remote (ip) address.

Returns:
the calling remote (ip) address
SOAPResponse* base_soap::SOAPRequest::getResponse (  )  const

Returns the internal response object.

Returns:
the internal response object, the caller must not delete it
int base_soap::SOAPRequest::getUserId (  )  const

Gets the calling user id of this soap request.

Returns:
the calling user id, 0 for anonymous
base::String base_soap::SOAPRequest::getUserName (  )  const

Gets the calling user name.

Returns:
the calling user name
void base_soap::SOAPRequest::setClass ( const base::String &  classname  ) 

Set (change) class name.

Parameters:
classname the new class name
void base_soap::SOAPRequest::setContext ( int  context  ) 

Set (change) context.

Parameters:
context the new context
void base_soap::SOAPRequest::setInstance ( const base::String &  instance  ) 

Set (change) instance.

Parameters:
instance the new instance
void base_soap::SOAPRequest::setMethod ( const base::String &  method  ) 

Set (change) method name.

Parameters:
method the new method name
void base_soap::SOAPRequest::setProgram ( const base::String &  program  ) 

Set (change) calling program name.

Parameters:
program the new program name
void base_soap::SOAPRequest::setRemoteAddr ( const base::String &  addr  ) 

Set (change) calling remote (ip) address.

Parameters:
addr the new calling remote (ip) address
void base_soap::SOAPRequest::setResponse ( SOAPResponse *  response  ) 

Set the response.

Parameters:
response the response
void base_soap::SOAPRequest::setUserId ( int  userid  ) 

Set (change) calling user id.

Parameters:
userid the new user id
void base_soap::SOAPRequest::setUserName ( const base::String &  username  ) 

Set (change) calling user name.

Parameters:
username the new calling user name
void base_soap::SOAPRequest::toXML ( xercesc::MemBufFormatTarget *  target  )  const

Serializes this request into xml.

Parameters:
target returns the xml representation
base::String base_soap::SOAPRequest::toXML (  )  const

Returns xml representation of this request.

Returns:
the xml representation

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