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); }
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); }
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(); }
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); }
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 "; } }
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()); } }