Responder Class Referenceabstract

#include <Pt/Soap/Responder.h>

Dispatches requests to a service procedure.

Inherits Responder.

Inherited by HttpResponder.

Public Member Functions

 Responder (const ServiceDeclaration &decl, Remoting::ServiceDefinition &def)
 Construct with Service declaration and definition.
 
virtual ~Responder ()
 Destructor.
 
bool isFailed () const
 Indicates if the procedure has failed.
 
void cancel ()
 Resets to initial state.
 
const ServiceProcedure * activeProcedure () const
 The currently executing procedure.
 

Protected Member Functions

virtual void onReady ()
 The service procedure has finished. More...
 
virtual void onCancel ()
 Cancels all operations. More...
 
virtual void onFault (const Fault &fault)=0
 The service procedure has failed. More...
 
virtual void onResult ()=0
 The service procedure has finished. More...
 
void beginMessage (std::istream &is)
 Parses the XML-RPC message. More...
 
bool parseMessage ()
 Parses the XML-RPC message. More...
 
void finishMessage (System::EventLoop &loop)
 Parses the XML-RPC message. More...
 
void beginResult (std::ostream &os)
 Formats the XML-RPC result. More...
 
bool advanceResult ()
 Formats the XML-RPC message. More...
 
void finishResult ()
 Formats the XML-RPC message. More...
 
void setFault (int rc, const char *msg)
 Fails the service procedure. More...
 
Pt::Composer ** setProcedure (const std::string &name)
 Sets the service procedure.
 
void beginCall (System::EventLoop &loop)
 Begins the service procedure call.
 
Pt::DecomposerendCall ()
 Ends the service procedure call.
 

Member Function Documentation

◆ onReady()

virtual void onReady ( )
protectedvirtual

Derived responders implement this method to format and send the XML-RPC result. It is called when the service procedure has finished. Use beginResult(), advanceResult() and finishResult() to format the XML-RPC result.

Implements Responder.

◆ onCancel()

virtual void onCancel ( )
protectedvirtual

Derived responders implement this method to cancel all operations.

Implements Responder.

◆ onFault()

virtual void onFault ( const Fault fault)
protectedpure virtual

Derived responders implement this method to format and send the XML-RPC fault result. It is called when the service procedure has failed. Use beginResult(), advanceResult() and finishResult() to format the XML-RPC result.

◆ onResult()

virtual void onResult ( )
protectedpure virtual

Derived responders implement this method to format and send the XML-RPC result. It is called when the service procedure has finished. Use beginResult(), advanceResult() and finishResult() to format the XML-RPC result.

◆ beginMessage()

void beginMessage ( std::istream &  is)
protected

This method is used by derived responders to begin parsing a XML-RPC message from a std::istream.

◆ parseMessage()

bool parseMessage ( )
protected

This method is used by derived responders to parse a XML-RPC message. Each call consumes the available data from the std::istream set with beginMessage() and returns true if no more message data needs to be parsed, either because the message is complete or an error occured.

◆ finishMessage()

void finishMessage ( System::EventLoop loop)
protected

This method is used by derived responders after the XML-RPC message has been parsed by parseMessage(). This will execute the service procedure.

◆ beginResult()

void beginResult ( std::ostream &  os)
protected

This method is used by derived responders in onResult() and onError() to begin formatting a XML-RPC result to a std::ostream.

◆ advanceResult()

bool advanceResult ( )
protected

This method is used by derived responders in onResult() and onError() to format a XML-RPC result. Each call generates a chunk of the result and returns true if the message is complete.

◆ finishResult()

void finishResult ( )
protected

This method is used by derived responders in onResult() and onError() to format the end of a XML-RPC result. It is called after advanceResult() returns true.

◆ setFault()

void setFault ( int  rc,
const char *  msg 
)
protected

This method is used by derived responders to indicate that the service procedure should not be executed, but a fault result be generated instead.