KDSOAP
Public Types | Public Member Functions

KDSoapValue Class Reference

#include <KDSoapValue.h>

Inheritance diagram for KDSoapValue:
KDSoapMessage

List of all members.

Public Types

enum  Use { LiteralUse, EncodedUse }

Public Member Functions

 KDSoapValue ()
 ~KDSoapValue ()
 KDSoapValue (const QString &name, const QVariant &valueVariant, const QString &typeNameSpace=QString(), const QString &typeName=QString())
 KDSoapValue (const QString &name, const KDSoapValueList &childValues, const QString &typeNameSpace=QString(), const QString &typeName=QString())
 KDSoapValue (const KDSoapValue &other)
KDSoapValueoperator= (const KDSoapValue &other)
void swap (KDSoapValue &other)
bool isNull () const
QString name () const
QString namespaceUri () const
void setNamespaceUri (const QString &ns)
QVariant value () const
void setValue (const QVariant &value)
KDSoapValueListchildValues () const
bool operator== (const KDSoapValue &other) const
void setType (const QString &nameSpace, const QString &type)
QString typeNs () const
QString type () const

Detailed Description

KDSoapValue represents a value in a SOAP argument list. It is composed of the argument name, and actual value as a QVariant.

Optionally, the type name can be set (will become the xsi:type attribute, which gives type information at runtime).

In terms of the actual XML being sent or received, this represents one XML element or one XML attribute. childValues() contains the child XML elements of this XML element.


Member Enumeration Documentation

Defines the way the message should be serialized. See the "use" attribute for soap:body, in the WSDL file.

Enumerator:
LiteralUse 

data is serialized according to a given schema, no xsi:type attributes are written out

EncodedUse 

each message part references an abstract type using the xsi:type attribute


Constructor & Destructor Documentation

KDSoapValue::KDSoapValue ( )

Constructs an empty KDSoapValue. This usually indicates an error, e.g. when KDSoapValueList::child() doesn't find the child.

KDSoapValue::~KDSoapValue ( )

Destructor.

KDSoapValue::KDSoapValue ( const QString &  name,
const QVariant &  valueVariant,
const QString &  typeNameSpace = QString(),
const QString &  typeName = QString() 
)

Constructs a value from a QVariant.

Parameters:
namethe argument name (which corresponds to the element or attribute name in the XML)
valueVariantthis 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)
typeNameSpacenamespace of the type of this value; this is only useful if using KDSoapMessage::EncodedUse
typeNamelocalname of the type of this value; this is only useful if using KDSoapMessage::EncodedUse
KDSoapValue::KDSoapValue ( const QString &  name,
const KDSoapValueList childValues,
const QString &  typeNameSpace = QString(),
const QString &  typeName = QString() 
)

Constructs a "complex" value with child values

Parameters:
namethe argument name (which corresponds to the element or attribute name in the XML)
childValuesthe child elements and the attributes of this value.
typeNameSpacenamespace of the type of this value; this is only useful if using KDSoapMessage::EncodedUse
typeNamelocalname of the type of this value; this is only useful if using KDSoapMessage::EncodedUse
KDSoapValue::KDSoapValue ( const KDSoapValue other)

Copy constructor


Member Function Documentation

KDSoapValue& KDSoapValue::operator= ( const KDSoapValue other) [inline]

Assignment operator

Reimplemented in KDSoapMessage.

void KDSoapValue::swap ( KDSoapValue other) [inline]

Swaps the contents of other with the contents of this. Never throws.

bool KDSoapValue::isNull ( ) const

Returns true if this KDSoapValue was created with the default constructor.

QString KDSoapValue::name ( ) const

Returns the name of the argument, as passed to the constructor.

QString KDSoapValue::namespaceUri ( ) const

Returns the namespace of this argument, if it differs from the "message namespace".

void KDSoapValue::setNamespaceUri ( const QString &  ns)

Sets the namespace of this argument, if it differs from the "message namespace".

QVariant KDSoapValue::value ( ) const

Returns the value of the argument.

void KDSoapValue::setValue ( const QVariant &  value)

Sets the value of the argument.

KDSoapValueList & KDSoapValue::childValues ( ) const

Returns the list of child values (elements and attributes). The list is a reference, and can therefore be modified.

bool KDSoapValue::operator== ( const KDSoapValue other) const

Compares two KDSoapValues.

void KDSoapValue::setType ( const QString &  nameSpace,
const QString &  type 
)

Sets the type information for this KDSoapValue, so that it can be sent in the xsi:type attribute. This is only useful if using KDSoapMessage::EncodedUse.

For instance

 setType("http://www.w3.org/2001/XMLSchema-instance", "string")

will send xsi:type="xsd:string" in the message XML.

Parameters:
nameSpacenamespace of the type of this value
typelocalname of the type of this value
QString KDSoapValue::typeNs ( ) const

Returns the namespace of the type. Example: "http://www.w3.org/2001/XMLSchema-instance".

QString KDSoapValue::type ( ) const

Returns the localname of the type. Example: "string".


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/