Qt-based BB10 API Examples Documentation

Contents

QtSoapNamespaces Class Reference

The QtSoapNamespaces class provides a registry for XML namespaces and prefixes for use in QtSoap. More...

    #include <QtSoapNamespaces>

Public Functions

QString prefixFor ( const QString & uri )
void registerNamespace ( const QString & prefix, const QString & uri )

Static Public Members

QtSoapNamespaces & instance ()

Detailed Description

The QtSoapNamespaces class provides a registry for XML namespaces and prefixes for use in QtSoap.

When a QtSoapMessage is converted to XML via QtSoapMessage::toXmlString(), this class is used to find appropriate XML namespace prefixes for the QNames (qualified names) in the message.

To register a namespace with a prefix, call register(). prefixFor() will then return the prefix that is registered for the given namespace, if any.

To access the QtSoapNamespaces registry, call QtSoapNamespaces::instance().

    QtSoapNamespaces &registry = QtSoapNamespaces::instance();

    registry.register("pre", "http://www.example.com/");
    QString prefix = registry.prefixFor("http://www.example.com/"); // returns "pre"

See also QtSoapMessage.

Member Function Documentation

QtSoapNamespaces & QtSoapNamespaces::instance () [static]

Returns a reference to the QtSoapNamespaces singleton.

QString QtSoapNamespaces::prefixFor ( const QString & uri )

Returns the prefix for the namespace uri, or an empty string if no prefix has been registered for uri.

void QtSoapNamespaces::registerNamespace ( const QString & prefix, const QString & uri )

Registers the namespace uri with the prefix prefix.