|  | Home

# QtSoapType Class Reference

The QtSoapType class is the base class for all SOAP types in QtSoap. More...

     #include <QtSoapType>

Inherited by QtSoapArray, QtSoapSimpleType, and QtSoapStruct.

- List of all members, including inherited members

### Public Types

- enum Type { AnyURI, Array, Base64Binary, Boolean, ..., UnsignedShort }

### Public Functions

- QtSoapType ()
- QtSoapType ( const QtSoapQName & name, Type type = Other )
- QtSoapType ( const QtSoapType & copy )
- virtual ~QtSoapType ()
- virtual void clear ()
- virtual int count () const
- QString errorString () const
- virtual QString href () const
- virtual QString id () const
- virtual bool isValid () const
- virtual QtSoapQName name () const
- virtual bool parse ( QDomNode node )
- void setHref ( const QString & h )
- void setId ( const QString & i )
- void setName ( const QtSoapQName & name )
- virtual bool toBool () const
- virtual QDomElement toDomElement ( QDomDocument document ) const
- virtual int toInt () const
- virtual QString toString () const
- virtual Type type () const
- virtual QString typeName () const
- virtual QVariant value () const
- QtSoapType & operator= ( const QtSoapType & copy )
- virtual QtSoapType & operator[] ( int pos )
- virtual QtSoapType & operator[] ( const QtSoapQName & key )
- virtual QtSoapType & operator[] ( const QString & key )
- virtual const QtSoapType & operator[] ( int pos ) const
- virtual const QtSoapType & operator[] ( const QtSoapQName & key ) const
- virtual const QtSoapType & operator[] ( const QString & key ) const

### Static Public Members

- Type nameToType ( const QString & name )
- QString typeToName ( QtSoapType::Type t )

## Detailed Description

The QtSoapType class is the base class for all SOAP types in QtSoap.

Although it is not used to create data types, a QtSoapType reference can be conveniently used to inspect a tree of QtSoapType subclasses. Accessors from this base class, such as operator[](), allow safe navigation.

     const QtSoapType &root = message.returnValue();
     if (root["fault"].isValid()) {
         qWarning("Warning: %s", root["fault"]["faultstring"].toString().toLatin1().constData());
     }

This class holds the name(), type(), id() and href() of all its derived types.

If a QtSoapType reference or pointer points to a QtSoapStruct, a QtSoapArray or a QtSoapSimpleType, isValid() returns true.

See also QtSoapStruct, QtSoapArray, and QtSoapSimpleType.

## Member Type Documentation

### enum QtSoapType::Type

SOAP supports the types described in XML Schema Part 2: Datatypes listed at http://www.w3.org/TR/xmlschema-2/. The following values are represented using QtSoapSimpleType, except where noted.

Constant | Value | Description
--- | --- | ---
`QtSoapType::AnyURI` | `14` |
`QtSoapType::Array` | `41` | Represented by QtSoapArray
`QtSoapType::Base64Binary` | `10` |
`QtSoapType::Boolean` | `9` |
`QtSoapType::Byte` | `34` |
`QtSoapType::Date` | `3` |
`QtSoapType::DateTime` | `1` |
`QtSoapType::Decimal` | `27` |
`QtSoapType::Double` | `13` |
`QtSoapType::Duration` | `0` |
`QtSoapType::ENTITY` | `26` |
`QtSoapType::Float` | `12` |
`QtSoapType::GDay` | `7` |
`QtSoapType::GMonth` | `8` |
`QtSoapType::GMonthDay` | `6` |
`QtSoapType::GYear` | `5` |
`QtSoapType::GYearMonth` | `4` |
`QtSoapType::HexBinary` | `11` |
`QtSoapType::ID` | `24` |
`QtSoapType::IDREF` | `25` |
`QtSoapType::Int` | `32` |
`QtSoapType::Integer` | `28` |
`QtSoapType::Language` | `20` |
`QtSoapType::Long` | `31` |
`QtSoapType::NCName` | `23` |
`QtSoapType::NMTOKEN` | `22` |
`QtSoapType::NOTATION` | `16` |
`QtSoapType::Name` | `21` |
`QtSoapType::NegativeInteger` | `30` |
`QtSoapType::NonNegativeInteger` | `35` |
`QtSoapType::NonPositiveInteger` | `29` |
`QtSoapType::NormalizedString` | `18` |
`QtSoapType::Other` | `43` |
`QtSoapType::PositiveInteger` | `37` |
`QtSoapType::QName` | `15` |
`QtSoapType::Short` | `33` |
`QtSoapType::String` | `17` |
`QtSoapType::Struct` | `42` | Represented by QtSoapStruct
`QtSoapType::Time` | `2` |
`QtSoapType::Token` | `19` |
`QtSoapType::UnsignedByte` | `40` |
`QtSoapType::UnsignedInt` | `38` |
`QtSoapType::UnsignedLong` | `36` |
`QtSoapType::UnsignedShort` | `39` |

## Member Function Documentation

### QtSoapType::QtSoapType ()

Constructs a QtSoapType.

### QtSoapType::QtSoapType ( const QtSoapQName & name, Type type = Other )

Constructs a QtSoapType whose name is name and type is type. This contructor is usually only called by constructors in subclasses.

### QtSoapType::QtSoapType ( const QtSoapType & copy )

Creates a QtSoapType copy of copy.

### QtSoapType::~QtSoapType () `[virtual]`

Destructs a QtSoapType.

### void QtSoapType::clear () `[virtual]`

Clears any contents. In this base implementation, clear() does nothing.

### int QtSoapType::count () const `[virtual]`

Returns the number of child items in this QtSoapType. In the base implementation, this returns 0.

### QString QtSoapType::errorString () const

Returns a human readable explanation of the most recent error.

### QString QtSoapType::href () const `[virtual]`

Returns the href attribute of this QtSoapType.

See also setHref().

### QString QtSoapType::id () const `[virtual]`

Returns the ID of this QtSoapType.

See also setId().

### bool QtSoapType::isValid () const `[virtual]`

Returns true if this object is of type QtSoapStruct, QtSoapArray or QtSoapSimpletype; otherwise returns false.

### QtSoapQName QtSoapType::name () const `[virtual]`

Returns the QName (qualified name) of this QtSoapType.

See also setName().

### Type QtSoapType::nameToType ( const QString & name ) `[static]`

Returns the QtSoapType::Type called name.

### bool QtSoapType::parse ( QDomNode node ) `[virtual]`

Attempts to interpret node as a QtSoapType, and returns true if successful. This base implementation always returns false.

### void QtSoapType::setHref ( const QString & h )

Sets the href attribute of this QtSoapType to h.

See also href().

### void QtSoapType::setId ( const QString & i )

Sets the ID of this QtSoapType to i.

See also id().

### void QtSoapType::setName ( const QtSoapQName & name )

Sets the QName (qualified name) of this QtSoapType to name.

See also name().

### bool QtSoapType::toBool () const `[virtual]`

Returns false.

### QDomElement QtSoapType::toDomElement ( QDomDocument document ) const `[virtual]`

Returns the QDomElement representation of this QtSoapType as a child of document.

### int QtSoapType::toInt () const `[virtual]`

Returns 0.

### QString QtSoapType::toString () const `[virtual]`

Returns QString::null.

### Type QtSoapType::type () const `[virtual]`

Returns the type as a QtSoapType::Type.

### QString QtSoapType::typeName () const `[virtual]`

Returns the QString representation of this QtSoapType's type.

### QString QtSoapType::typeToName ( QtSoapType::Type t ) `[static]`

Returns the QString equivalent of type t.

### QVariant QtSoapType::value () const `[virtual]`

Returns the value of this QtSoapType. In the base implementation, an invalid QVariant() is returned.

### QtSoapType & QtSoapType::operator= ( const QtSoapType & copy )

Makes this QtSoapType equal to copy.

### QtSoapType & QtSoapType::operator[] ( int pos ) `[virtual]`

Returns a reference to the child item at ordinal position pos. If no item exists at this position, returns an empty QtSoapType.

### QtSoapType & QtSoapType::operator[] ( const QtSoapQName & key ) `[virtual]`

This is an overloaded function.

Returns a reference to the child item whose QName (qualified name) is key. If no item exists with this key an empty QtSoapType is returned.

### QtSoapType & QtSoapType::operator[] ( const QString & key ) `[virtual]`

This is an overloaded function.

Returns a reference to the child item whose QName (qualified name) is key, regardless of the qualified name's URI. If no item exists with this key, an empty QtSoapType is returned.

### const QtSoapType & QtSoapType::operator[] ( int pos ) const `[virtual]`

This is an overloaded function.

Returns a reference to the child item at ordinal position pos. If no item exists at this position, returns an empty QtSoapType.

### const QtSoapType & QtSoapType::operator[] ( const QtSoapQName & key ) const `[virtual]`

This is an overloaded function.

Returns a reference to the child item whose QName (qualified name) is key. If no item exists with this key, returns an empty QtSoapType.

### const QtSoapType & QtSoapType::operator[] ( const QString & key ) const `[virtual]`

This is an overloaded function.

Returns a reference to the child item whose QName (qualified name) is key, regardless of the qualified name's URI. If no item exists with this key, returns an empty QtSoapType.