Soap Service

Soap Service — Classes used to implement SOAP service functionality.

Synopsis

#include <prolinga/Soap.hpp>

class PlSoapService
{
        public:
                PlSoapService();
                ~PlSoapService();
                int       soapServiceStart          (char *server_host, 
                                                     int server_port,
                                                     int num_threads,
                                                     int server_comp,
                                                     char *log_file,
                                                     int log_level);
                ...
};
typedef PlSoapService *PlSoapServicePtr;


class PlSoapProcess
{
        public:
                PlSoapProcess();
                ~PlSoapProcess();
                xmlDocPtr       getRequest          (void);
                void            putResponse         (xmlDocPtr docResponse);
                ...
};
typedef PlSoapProcess *PlSoapProcessPtr;


  

Description

These classes are used to implement a SOAP service.

Details

PlSoapService::soapServiceStart ()

int       PlSoapService::soapServiceStart           (char *server_host
                                                     int server_port,
                                                     int num_threads,
                                                     int server_comp,
                                                     char *log_file,
                                                     int log_level);

This function is called to start the Soap service. The service will wait and listen for for any requests coming in. Function PlSoapLink will get called for the processing of such a request. Within that function class PlSoapProcess is available for the handling of the request and response documents.

Keep in mind that the function PlSoapService::soapServiceStart will start an infinite for-loop, so code placed after this function will not be executed. If however you need to execute code after shutting down the service, you can start this function in a forked process.

server_host :

the name or IP number the machine will bind to. Default is localhost.

server_port :

the TCP port number the machine will bind to. Default is 8001.

num_threads :

the number of threads you want to run with. Default is 5.

server_comp :

the level of compression of request/response files before sending (0-9, 9=best).No Default.

log_file :

the path and name of the log file. Default is /usr/tmp/prolingaSoap.log.

log_level :

the level of logging (0-5).No Default.

Returns :

error status in case the service falls over.

PlSoapProcess::getRequest ()

xmlDocPtr       PlSoapProcess::getRequest           (void);

This function returns the current request.

Returns :

the current request as libxml2 document. Do NOT try to free/de-allocate the request, since it can make the system unstable. Internal class functions take care of this.

PlSoapProcess::putResponse ()

void       PlSoapProcess::putResponse           (xmlDocPtr docResponse);

This function stores the response which will get send back to the caller.

docResponse :

the current response as libxml2 document.