KDSOAP
Public Member Functions

KDSoapServerObjectInterface Class Reference

#include <KDSoapServerObjectInterface.h>

List of all members.

Public Member Functions

 KDSoapServerObjectInterface ()
virtual ~KDSoapServerObjectInterface ()
virtual void processRequest (const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction)
KDSoapHeaders requestHeaders () const
QByteArray soapAction () const
void setResponseHeaders (const KDSoapHeaders &headers)
void setFault (const QString &faultCode, const QString &faultString, const QString &faultActor, const QString &detail)
bool hasFault () const

Detailed Description

Base class for server objects, i.e. objects implementing the methods that can be called by SOAP clients.

Your server object must derive from both QObject (directly or indirectly) and from KDSoapServerObjectInterface. The virtual method processRequest is called whenever a SOAP request is being made. To handle the call, either reimplement processRequest and do the dispatching manually (not recommended), or use kdwsdl2cpp to generate the base class for your server object.

Example for manual handling: class EmployeeServerObject : public QObject, public KDSoapServerObjectInterface { Q_OBJECT Q_INTERFACES(KDSoapServerObjectInterface)

public: // methods published to SOAP QString getEmployeeCountry(const QString& employeeName); [...] }; And in the .cpp file: #define KDWSDLServerClass EmployeeServerObject #include "swsdl_employee.cpp"

swsdl_employee.cpp will contain the code which calls getEmployeeCountry when parsing a KDSoapMessage that is a "getEmployeeCountry" request.


Constructor & Destructor Documentation

KDSoapServerObjectInterface::KDSoapServerObjectInterface ( )

Constructor

KDSoapServerObjectInterface::~KDSoapServerObjectInterface ( ) [virtual]

Destructor


Member Function Documentation

void KDSoapServerObjectInterface::processRequest ( const KDSoapMessage request,
KDSoapMessage response,
const QByteArray &  soapAction 
) [virtual]

Handle request and return response. The default implementation in this base class is to simply return a fault "method not found". Subclasses must implement the dispatching to actual implementation methods.

KDSoapHeaders KDSoapServerObjectInterface::requestHeaders ( ) const

Returns the SOAP headers that were provided together with the SOAP request. This can be used to retrieve authentication headers, or any kind of session (per-client) data.

QByteArray KDSoapServerObjectInterface::soapAction ( ) const

Returns the "Soap Action" header sent by the client.

void KDSoapServerObjectInterface::setResponseHeaders ( const KDSoapHeaders headers)

Sets the soap headers to be sent in the response

void KDSoapServerObjectInterface::setFault ( const QString &  faultCode,
const QString &  faultString,
const QString &  faultActor,
const QString &  detail 
)

Instructs KD SOAP to return a fault message instead of the return value of the slot.

Parameters:
faultCodeA code for identifying the fault. Example: "Server.EntryNotFound", or "Client.Authentication". Must not be empty.
faultStringA human readable explanation of the fault
faultActorInformation about who caused the fault to happen
Holdsapplication specific error information related to the Body element

See http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 for more details.

bool KDSoapServerObjectInterface::hasFault ( ) const

Returns true if setFault was called in the current method invocation.


The documentation for this class was generated from the following files:
 All Classes Functions Enumerations Enumerator

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-soap/