KD SOAP API Documentation 2.2
|
#include <KDSoapMessage.h>
Public Member Functions | |
KDSoapMessage () | |
KDSoapMessage (const KDSoapMessage &other) | |
~KDSoapMessage () | |
void | addArgument (const QString &argumentName, const KDSoapValueList &argumentValueList, const QString &typeNameSpace=QString(), const QString &typeName=QString()) |
void | addArgument (const QString &argumentName, const QVariant &argumentValue, const QString &typeNameSpace=QString(), const QString &typeName=QString()) |
KDSoapValueList & | arguments () |
const KDSoapValueList & | arguments () const |
void | createFaultMessage (const QString &faultCode, const QString &faultText, KDSoap::SoapVersion soapVersion) |
QString | faultAsString () const |
bool | hasMessageAddressingProperties () const |
bool | isFault () const |
KDSoapMessageAddressingProperties | messageAddressingProperties () const |
bool | operator!= (const KDSoapMessage &other) const |
KDSoapMessage & | operator= (const KDSoapMessage &other) |
KDSoapMessage & | operator= (const KDSoapValue &other) |
bool | operator== (const KDSoapMessage &other) const |
void | setFault (bool fault) |
void | setMessageAddressingProperties (const KDSoapMessageAddressingProperties &map) |
void | setUse (Use use) |
Use | use () const |
Public Member Functions inherited from KDSoapValue | |
KDSoapValue () | |
KDSoapValue (const KDSoapValue &other) | |
KDSoapValue (const QString &name, const KDSoapValueList &childValues, const QString &typeNameSpace=QString(), const QString &typeName=QString()) | |
KDSoapValue (const QString &name, const QVariant &valueVariant, const QString &typeNameSpace=QString(), const QString &typeName=QString()) | |
~KDSoapValue () | |
void | addNamespaceDeclaration (const QXmlStreamNamespaceDeclaration &namespaceDeclaration) |
KDSoapValueList & | childValues () const |
QXmlStreamNamespaceDeclarations | environmentNamespaceDeclarations () const |
bool | isNil () const |
bool | isNull () const |
bool | isQualified () const |
QString | name () const |
QXmlStreamNamespaceDeclarations | namespaceDeclarations () const |
QString | namespaceUri () const |
bool | operator!= (const KDSoapValue &other) const |
KDSoapValue & | operator= (const KDSoapValue &other) |
bool | operator== (const KDSoapValue &other) const |
void | setEnvironmentNamespaceDeclarations (const QXmlStreamNamespaceDeclarations &environmentNamespaceDeclarations) |
void | setNamespaceDeclarations (const QXmlStreamNamespaceDeclarations &namespaceDeclarations) |
void | setNamespaceUri (const QString &ns) |
void | setNillable (bool nillable) |
void | setQualified (bool qualified) |
void | setType (const QString &nameSpace, const QString &type) |
void | setValue (const QVariant &value) |
KDSoapValueList | split () const |
void | swap (KDSoapValue &other) |
QByteArray | toXml (Use use=LiteralUse, const QString &messageNamespace=QString()) const |
QString | type () const |
QString | typeNs () const |
QVariant | value () const |
Additional Inherited Members | |
Public Types inherited from KDSoapValue | |
enum | Use { LiteralUse , EncodedUse } |
Protected Member Functions inherited from KDSoapValue | |
void | setName (const QString &name) |
The KDSoapMessage class represents one message sent or received via SOAP.
Definition at line 28 of file KDSoapMessage.h.
KDSoapMessage::KDSoapMessage | ( | ) |
Constructs an empty KDSoapMessage object.
Definition at line 34 of file KDSoapMessage.cpp.
Referenced by createFaultMessage().
KDSoapMessage::~KDSoapMessage | ( | ) |
Destructs the KDSoapMessage object.
Definition at line 68 of file KDSoapMessage.cpp.
KDSoapMessage::KDSoapMessage | ( | const KDSoapMessage & | other | ) |
Constructs a copy of the object given by other
.
Definition at line 39 of file KDSoapMessage.cpp.
void KDSoapMessage::addArgument | ( | const QString & | argumentName, |
const KDSoapValueList & | argumentValueList, | ||
const QString & | typeNameSpace = QString() , |
||
const QString & | typeName = QString() |
||
) |
Adds a complex-type argument to the message.
argumentName | the argument name (which corresponds to the element or attribute name in the XML) |
argumentValueList | KDSoapValueList of child values. |
typeNameSpace | namespace of the type of this value; this is only useful if using KDSoapMessage::EncodedUse |
typeName | localname of the type of this value; this is only useful if using KDSoapMessage::EncodedUse |
Equivalent to
If the message isQualified(), the value will be set to qualified as well, for convenience.
Definition at line 81 of file KDSoapMessage.cpp.
References QList::append(), KDSoapValue::childValues(), KDSoapValue::isQualified(), and KDSoapValue::setQualified().
void KDSoapMessage::addArgument | ( | const QString & | argumentName, |
const QVariant & | argumentValue, | ||
const QString & | typeNameSpace = QString() , |
||
const QString & | typeName = QString() |
||
) |
Adds an argument to the message.
argumentName | the argument name (which corresponds to the element or attribute name in the XML) |
argumentValue | this QVariant can hold either a simple value, or a KDSoapValueList of child values. (the KDSoapValueList support is mostly for the convenience of the kdwsdl2cpp generated code) |
typeNameSpace | namespace of the type of this value; this is only useful if using KDSoapMessage::EncodedUse |
typeName | localname of the type of this value; this is only useful if using KDSoapMessage::EncodedUse |
Equivalent to
If the message isQualified(), the value will be set to qualified as well, for convenience.
Definition at line 72 of file KDSoapMessage.cpp.
References QList::append(), KDSoapValue::childValues(), KDSoapValue::isQualified(), and KDSoapValue::setQualified().
Referenced by createFaultMessage().
KDSoapValueList & KDSoapMessage::arguments | ( | ) |
Returns the arguments for the message. The list can be modified, in order to modify the message.
Definition at line 95 of file KDSoapMessage.cpp.
References KDSoapValue::childValues().
const KDSoapValueList & KDSoapMessage::arguments | ( | ) | const |
Returns the arguments for the message. The list is readonly; useful for inspecting a response.
Definition at line 100 of file KDSoapMessage.cpp.
References KDSoapValue::childValues().
void KDSoapMessage::createFaultMessage | ( | const QString & | faultCode, |
const QString & | faultText, | ||
KDSoap::SoapVersion | soapVersion | ||
) |
Turns this message into a "fault" message, using the given code and description. This encapsulates the differences between SOAP 1.1 and 1.2. Used internally, and by server implementations that handle dynamic calls
Definition at line 154 of file KDSoapMessage.cpp.
References KDSoapMessage(), addArgument(), KDSoapValueList::addArgument(), QString::fromLatin1(), KDSoapValue::setName(), KDSoapValue::setNamespaceUri(), KDSoap::SOAP1_2, KDSoapNamespaceManager::soapEnvelope(), and KDSoapNamespaceManager::soapEnvelope200305().
Referenced by KDSoapPendingCall::Private::parseReply(), KDSoapServerObjectInterface::processRequest(), KDSoapServerObjectInterface::processRequestWithPath(), and KDSoapMessageReader::xmlToMessage().
QString KDSoapMessage::faultAsString | ( | ) | const |
Definition at line 115 of file KDSoapMessage.cpp.
References QString::arg(), KDSoapValueList::child(), KDSoapValue::childValues(), QString::endsWith(), QString::fromLatin1(), QString::isEmpty(), KDSoapValue::isNull(), KDSoapValue::namespaceUri(), QVariant::toString(), QObject::tr(), and KDSoapValue::value().
bool KDSoapMessage::hasMessageAddressingProperties | ( | ) | const |
Return whether a KDSoapMessageAddressingProperties has been set for this KDSoapMessage
Definition at line 185 of file KDSoapMessage.cpp.
Referenced by KDSoapMessageWriter::messageToXml().
bool KDSoapMessage::isFault | ( | ) | const |
true
if this message is a "fault" message, or if an error occurred while parsing the XML.A fault message is the message returned by a SOAP server when an error occurred in the processing of the request.
Definition at line 110 of file KDSoapMessage.cpp.
Referenced by KDSoapMessageWriter::messageToXml(), and KDSoapPendingCall::Private::parseReply().
KDSoapMessageAddressingProperties KDSoapMessage::messageAddressingProperties | ( | ) | const |
Return the messageAddressingProperties related to the KDSoapMessage
Definition at line 174 of file KDSoapMessage.cpp.
Referenced by KDSoapMessageWriter::messageToXml(), and KDSoapClientInterfacePrivate::prepareRequestBuffer().
bool KDSoapMessage::operator!= | ( | const KDSoapMessage & | other | ) | const |
Compares two KDSoapMessages
Definition at line 63 of file KDSoapMessage.cpp.
KDSoapMessage & KDSoapMessage::operator= | ( | const KDSoapMessage & | other | ) |
Copies the contents of the object given by other
.
Definition at line 45 of file KDSoapMessage.cpp.
References KDSoapValue::operator=().
KDSoapMessage & KDSoapMessage::operator= | ( | const KDSoapValue & | other | ) |
Fills in KDSoapMessage from a KDSoapValue.
Definition at line 52 of file KDSoapMessage.cpp.
References KDSoapValue::operator=().
bool KDSoapMessage::operator== | ( | const KDSoapMessage & | other | ) | const |
Compares two KDSoapMessages
Definition at line 58 of file KDSoapMessage.cpp.
References KDSoapValue::operator==().
void KDSoapMessage::setFault | ( | bool | fault | ) |
Turns this message into a "fault" message. Normally this is only used in server implementations that handle dynamic calls.
Definition at line 149 of file KDSoapMessage.cpp.
Referenced by KDSoapMessageReader::xmlToMessage().
void KDSoapMessage::setMessageAddressingProperties | ( | const KDSoapMessageAddressingProperties & | map | ) |
Attach to a KDSoapMessage the message addressing properties that will be written in its header. Calling this will make hasMessageAddressingProperties() return true.
Definition at line 179 of file KDSoapMessage.cpp.
Referenced by KDSoapClientInterfacePrivate::prepareRequestBuffer(), and KDSoapMessageReader::xmlToMessage().
void KDSoapMessage::setUse | ( | Use | use | ) |
Define the way the message should be serialized. The default value is LiteralUse.
Definition at line 195 of file KDSoapMessage.cpp.
References use().
KDSoapMessage::Use KDSoapMessage::use | ( | ) | const |
Returns the value passed to setUse().
Definition at line 190 of file KDSoapMessage.cpp.
Referenced by KDSoapMessageWriter::messageToXml(), and setUse().