本文整理汇总了C++中QtSoapMessage::isFault方法的典型用法代码示例。如果您正苦于以下问题:C++ QtSoapMessage::isFault方法的具体用法?C++ QtSoapMessage::isFault怎么用?C++ QtSoapMessage::isFault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtSoapMessage
的用法示例。
在下文中一共展示了QtSoapMessage::isFault方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readClient
void ctkSoapConnectionRunnable::readClient(QTcpSocket& socket)
{
//qDebug() << socket->readAll();
while (socket.canReadLine()) {
QString line = socket.readLine();
qDebug() << line;
if (line.trimmed().isEmpty())
{
// Read the http body, which contains the soap message
QByteArray body = socket.readAll();
qDebug() << body;
if (body.trimmed().isEmpty())
{
qDebug() << "Message body empty";
return;
}
QtSoapMessage msg;
if (!msg.setContent(body))
{
qDebug() << "QtSoap import failed:" << msg.errorString();
return;
}
QtSoapMessage reply;
emit incomingSoapMessage(msg, &reply);
if (reply.isFault())
{
qDebug() << "QtSoap reply faulty";
return;
}
qDebug() << "SOAP reply:";
QString soapContent = reply.toXmlString();
QByteArray block;
block.append("HTTP/1.1 200 OK\n");
block.append("Content-Type: text/xml;charset=utf-8\n");
block.append("Content-Length: ").append(QString::number(soapContent.size())).append("\n");
block.append("\n");
block.append(soapContent);
qDebug() << block;
socket.write(block);
}
}
}
示例2: getResponse
void TPDownload::getResponse(const QtSoapMessage &message)
{
downloading = false;
QString result;
QDomDocument pwx("PWX");
if (!message.isFault()) {
const QtSoapType &response = message.returnValue();
QDomNode workout = response.toDomElement(pwx).firstChild();
pwx.appendChild(workout);
}
completed(pwx);
}
示例3: getResponse
void TPUpload::getResponse(const QtSoapMessage &message)
{
uploading = false;
QString result;
if (message.isFault()) {
result = tr("Error:") + qPrintable(message.faultString().toString());
} else {
// SOAP call succeeded, but was the file accepted?
if (message.returnValue().toString() == "true") result = tr("Upload successful");
else result = tr("Upload failed - file rejected");
}
completed(result);
}
示例4: getResponse
void Easter::getResponse(const QtSoapMessage &message)
{
if (message.isFault()) {
qDebug("Error: %s", qPrintable(message.faultString().toString()));
}
else {
QString res = message.returnValue().toString();
QDateTime dt = QDateTime::fromString(res, Qt::ISODate);
if (dt.isValid())
res = QLocale::c().toString(dt.date());
qDebug("Easter is: %s", res.toLatin1().constData());
}
QCoreApplication::quit();
}
示例5: getResponse
void TimeSpiderSettingsDialog::getResponse( const QtSoapMessage &message )
{
QApplication::restoreOverrideCursor( );
QString xml = message.toXmlString( );
qDebug( ) << "Got request login SOAP response: " << xml;
if( message.isFault( ) ) {
(void)QMessageBox::warning( this, QString( APPLICATION_NAME ),
tr( "The service returned an error message: %1")
.arg( message.faultString( ).value( ).toString( ) ),
QMessageBox::Ok );
return;
}
(void)QMessageBox::information( this, QString( APPLICATION_NAME ),
tr( "You should receive a registration email. Enter the token into the corresponding field in the settings dialog." ),
QMessageBox::Ok );
}
示例6: getResponse
void TPAthlete::getResponse(const QtSoapMessage &message)
{
waiting = false;
QString resultStr;
QList< QMap<QString, QString> > athletelist;
if (message.isFault()) {
resultStr = tr("Error:") + qPrintable(message.faultString().toString());
}
else {
const QtSoapType &response = message.returnValue();
if (response.isValid()) {
// lets take look at the payload as a DomDocument
// I tried to use the QtSoapType routines to walk
// through the reponse tree but couldn't get them
// to work. This code could be simplified if we
// use the QtSoap routines instead.
QDomDocument doc;
QDomElement results = response.toDomElement(doc);
QMap<QString, QString> athlete;
for (QDomElement personbase = results.firstChildElement("PersonBase");
!personbase.isNull();
personbase = personbase.nextSiblingElement()) {
athlete.clear();
// shove all the personbase attribs into a QMap
for (QDomNode child = personbase.firstChild();
!child.isNull();
child = child.nextSibling()) {
athlete.insert(child.nodeName(), child.toElement().text());
}
athletelist << athlete;
}
}
}
// return what we got (empty if non-valid response)
completed(resultStr, athletelist);
}
示例7: getResponse
void KEcm::getResponse(const QtSoapMessage &message)
{
//std::cout << "\nresponse " << message.toXmlString().toStdString();
if (message.isFault()) {
std::cout << "\n" << message.faultDetail().toString().toStdString();
qDebug("Errorssssss: %s", qPrintable(message.faultString().toString()));
}else {
/* QString res = message.returnValue().toString();
QDateTime dt = QDateTime::fromString(res, Qt::ISODate);
if (dt.isValid())
res = QLocale::c().toString(dt.date());
*/
const QtSoapType &docInfo = message.returnValue();
qDebug() << docInfo[QtSoapQName("dDocName","http://www.stellent.com/DocInfo/")].toString().toLatin1().constData();
//qDebug("Easter is: %s", docInfo["DocInfoByNameResponse"].value().toString().toLatin1().constData());
//qDebug("Easter is: %s", docInfo.count());
std::cout << "\n\n\n\n\n\nTeste ";
//qDebug() << docInfo["DocInfoByNameResponse"]["DocInfoByNameResult"]["ContentInfo"]["dDocName"].toString().toLatin1().constData();
//qDebug() << "TDDDD" << docInfo[0]["dDocName"].value().toString().toLatin1().constData();
int docInfoCount = docInfo.count();
int docInfoCounty = 0;
for(int x= 0; x < docInfoCount; x++){
docInfoCounty = docInfo[x].count();
for(int y= 0; y < docInfoCounty; y++){
qDebug("Nome: %s \t Value: %s",
QString(docInfo[x][y].name().name()).toLatin1().constData(),
docInfo[x][y].value().toString().toLatin1().constData());
}
qDebug("\n\n");
}
std::cout << "\n\n\n\n\n\nTeste ";
}
}
示例8: getResponse
void QGenieGetRouterWlanInfoThread::getResponse(QtSoapMessage &message,QUuid &uuid,QString &session)
{
GeniePlugin_WSetupPlugin::output_log(QString("recv:get wlan infomation response,uuid-%1").arg(uuid.toString()));
if(!m_bcontinue)
return;
/* if(uuid == QUuid("{14E65BB7-0D3B-4c90-871E-187E58D6712C}"))//start
{
if(message.isFault())
{
qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
}
else
{
if( message.returnResponseCode().toString().toInt() == 0)
{
m_bstart_ok = true;
}
}
if(!m_bstart_ok)
{
m_bcontinue = false;
emit getwlaninfo_complete(false,QString(),QString(),QString(),QString());
}
}
else */if(uuid == QUuid("{CFE911FE-C5E8-4a0e-A073-6FD28B017E41}"))//ssid
{
if(message.isFault())
{
qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
}
else
{
if( message.returnResponseCode().toString().toInt() == 0)
{
m_bgetssid_ok = true;
const QtSoapType &value = message.returnValue();
m_strssid = value["NewSSID"].value().toString();
}
}
if(!m_bgetssid_ok)
{
m_bcontinue = false;
emit getwlaninfo_complete(false,QString(),QString(),QString(),QString());
}
}
else if(uuid == QUuid("{B8D2DCFD-0A58-4e46-882A-5EB1DC77EBB4}"))//key
{
if(message.isFault())
{
qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
}
else
{
if( message.returnResponseCode().toString().toInt() == 0)
{
m_bgetkey_ok = true;
const QtSoapType &value = message.returnValue();
m_strkey = value["NewWPAPassphrase"].value().toString();
}
}
if(!m_bgetkey_ok)
{
m_bcontinue = false;
emit getwlaninfo_complete(false,QString(),QString(),QString(),QString());
}
}
if(m_bgetssid_ok && m_bgetkey_ok)
{
m_bcontinue = false;
emit getwlaninfo_complete(true,m_strssid,m_strkey,QString(),QString());
}
}