MythTV master
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
SOAPClient Class Reference

Subclass SOAPClient to perform actions using the command URL. More...

#include <libmythupnp/soapclient.h>

Inheritance diagram for SOAPClient:
[legend]

Public Member Functions

 SOAPClient (QUrl url, QString sNamespace, QString sControlPath)
 Full SOAPClient constructor. More...
 
 SOAPClient ()=default
 Empty SOAPClient constructor. More...
 
virtual ~SOAPClient ()=default
 
bool Init (const QUrl &url, const QString &sNamespace, const QString &sControlPath)
 SOAPClient Initializer. More...
 

Protected Member Functions

int GetNodeValue (const QDomNode &node, const QString &sName, int nDefault) const
 Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found. More...
 
bool GetNodeValue (const QDomNode &node, const QString &sName, bool bDefault) const
 Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found. More...
 
QString GetNodeValue (const QDomNode &node, const QString &sName, const QString &sDefault) const
 Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found. More...
 
QString GetNodeValue (const QDomNode &node, const QString &sName, const char *sDefault) const
 
QDomNode FindNode (const QString &sName, const QDomNode &baseNode) const
 Used by GeNodeValue() methods to find the named node. More...
 
QDomDocument SendSOAPRequest (const QString &sMethod, QStringMap &list, int &nErrCode, QString &sErrDesc)
 Actually sends the sMethod action to the command URL specified in the constructor (url+[/]+sControlPath). More...
 

Protected Attributes

QUrl m_url
 
QString m_sNamespace
 
QString m_sControlPath
 

Private Member Functions

QDomNode FindNodeInternal (QStringList &sParts, const QDomNode &curNode) const
 This is an internal function used to implement FindNode. More...
 

Detailed Description

Subclass SOAPClient to perform actions using the command URL.

Definition at line 24 of file soapclient.h.

Constructor & Destructor Documentation

◆ SOAPClient() [1/2]

SOAPClient::SOAPClient ( QUrl  url,
QString  sNamespace,
QString  sControlPath 
)

Full SOAPClient constructor.

After constructing the client with this constructor it is ready for SendSOAPRequest().

Parameters
urlThe host and port portion of the command URL
sNamespaceThe part of the action before the # character
sControlPathThe path portion of the command URL

Definition at line 33 of file soapclient.cpp.

◆ SOAPClient() [2/2]

SOAPClient::SOAPClient ( )
default

Empty SOAPClient constructor.

When this is used, Init() Must be called before SendSOAPRequest().

◆ ~SOAPClient()

virtual SOAPClient::~SOAPClient ( )
virtualdefault

Member Function Documentation

◆ FindNode()

QDomNode SOAPClient::FindNode ( const QString &  sName,
const QDomNode &  baseNode 
) const
protected

Used by GeNodeValue() methods to find the named node.

Definition at line 84 of file soapclient.cpp.

Referenced by GetNodeValue().

◆ FindNodeInternal()

QDomNode SOAPClient::FindNodeInternal ( QStringList &  sParts,
const QDomNode &  curNode 
) const
private

This is an internal function used to implement FindNode.

Definition at line 92 of file soapclient.cpp.

Referenced by FindNode(), and FindNodeInternal().

◆ GetNodeValue() [1/4]

bool SOAPClient::GetNodeValue ( const QDomNode &  node,
const QString &  sName,
bool  bDefault 
) const
protected

Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found.

Definition at line 120 of file soapclient.cpp.

◆ GetNodeValue() [2/4]

QString SOAPClient::GetNodeValue ( const QDomNode &  node,
const QString &  sName,
const char *  sDefault 
) const
inlineprotected

Definition at line 49 of file soapclient.h.

◆ GetNodeValue() [3/4]

QString SOAPClient::GetNodeValue ( const QDomNode &  node,
const QString &  sName,
const QString &  sDefault 
) const
protected

Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found.

Definition at line 142 of file soapclient.cpp.

◆ GetNodeValue() [4/4]

int SOAPClient::GetNodeValue ( const QDomNode &  node,
const QString &  sName,
int  nDefault 
) const
protected

Gets the named value using QDomNode as the baseNode in the search, returns default if it is not found.

Definition at line 111 of file soapclient.cpp.

Referenced by MythXMLClient::GetConnectionInfo(), and GetNodeValue().

◆ Init()

bool SOAPClient::Init ( const QUrl &  url,
const QString &  sNamespace,
const QString &  sControlPath 
)

SOAPClient Initializer.

After constructing the client with the empty constructor call this before calling SendSOAPRequest() the first time.

Definition at line 46 of file soapclient.cpp.

◆ SendSOAPRequest()

QDomDocument SOAPClient::SendSOAPRequest ( const QString &  sMethod,
QStringMap list,
int &  nErrCode,
QString &  sErrDesc 
)
protected

Actually sends the sMethod action to the command URL specified in the constructor (url+[/]+sControlPath).

Parameters
sMethodmethod to be invoked. e.g. "SetChannel", "GetConnectionInfoResult"
listParsed as a series of key value pairs for the input params and then cleared and used for the output params.
nErrCodeset to zero on success, non-zero in case of error.
sErrDescreturns error description from device, when applicable.
Returns
Returns a QDomDocument containing output parameters on success.

Definition at line 182 of file soapclient.cpp.

Referenced by MythXMLClient::GetConnectionInfo().

Member Data Documentation

◆ m_sControlPath

QString SOAPClient::m_sControlPath
protected

Definition at line 69 of file soapclient.h.

Referenced by Init(), and SendSOAPRequest().

◆ m_sNamespace

QString SOAPClient::m_sNamespace
protected

Definition at line 68 of file soapclient.h.

Referenced by Init(), and SendSOAPRequest().

◆ m_url

QUrl SOAPClient::m_url
protected

Definition at line 67 of file soapclient.h.

Referenced by Init(), and SendSOAPRequest().


The documentation for this class was generated from the following files: