Client Class Referenceabstract

#include <Pt/Soap/Client.h>

A client for remote procedure calls.

Inherits Client.

Inherited by HttpClient.

Public Member Functions

 Client (ServiceDeclaration &service)
 Constructor.
 
virtual ~Client ()
 Destructor.
 
const RemoteCall * activeProcedure () const
 The currently executing procedure.
 
void cancel ()
 Cancels the currently executing procedure.
 
bool isFailed () const
 Indicates if the procedure has failed.
 

Protected Member Functions

bool advanceMessage ()
 Formats the XML-RPC message. More...
 
void beginMessage (std::ostream &os)
 Formats the XML-RPC message. More...
 
void beginResult (std::istream &is)
 Parses the XML-RPC result. More...
 
void finishMessage ()
 Formats the XML-RPC message. More...
 
virtual void onBeginInvoke ()=0
 An asynchronous remote procedure is invoked. More...
 
virtual void onCancel ()
 Cancels the remote procedure call. More...
 
virtual void onInvoke ()=0
 A synchronous remote procedure is called. More...
 
bool parseResult ()
 Parses the XML-RPC result. More...
 
void processResult (std::istream &is)
 Parses the XML-RPC result. More...
 
void setFault (int rc, const char *msg)
 Fails the current procedure. More...
 
void setReady ()
 Parses the XML-RPC result. More...
 

Member Function Documentation

virtual void onCancel ( )
protectedvirtual

Derived Clients implement this method to cancel the remote procedure call.

Implements Client.

Reimplemented in HttpClient.

virtual void onBeginInvoke ( )
protectedpure virtual

Derived Clients implement this method to format and send a message to the service.

Implemented in HttpClient.

virtual void onInvoke ( )
protectedpure virtual

Derived Clients implement this method to format and send a message to the service and receive and parse the result.

Implemented in HttpClient.

void beginMessage ( std::ostream &  os)
protected

This method is used by derived Clients in onInvoke() and onCall() to begin formatting a XML-RPC message to a std::ostream.

bool advanceMessage ( )
protected

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

void finishMessage ( )
protected

This method is used by derived Clients in onInvoke() and onCall() to format the end of a XML-RPC message. It is called after advanceMessage() returns true.

void beginResult ( std::istream &  is)
protected

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

bool parseResult ( )
protected

This method is used by derived Clients to parse a XML-RPC result Each call consumes the available data from the std::istream set with beginResult() and returns true if the result is complete.

void processResult ( std::istream &  is)
protected

This method is used by derived Clients in in onCall() to parse a XML-RPC result from a std::istream.

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

This method is used by derived Clients before calling finishResult() so that the RemoteProcedure throws a Fault when the result is processed.

void setReady ( )
protectedinherited

This method is used by derived Clients after the XML-RPC result has been parsed by parseResult(). The current RemoteProcedure will receive completion notification to process the result.