本文整理汇总了C++中QtSoapMessage类的典型用法代码示例。如果您正苦于以下问题:C++ QtSoapMessage类的具体用法?C++ QtSoapMessage怎么用?C++ QtSoapMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QtSoapMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createUser
void Client::createUser(QString login, QString pass){
QtSoapMessage request;
request.setMethod("CreateUser");
request.addMethodArgument("login", "", login);
request.addMethodArgument("pass", "", pass);
qDebug() << "Checking login: " << login;
http.submitRequest(request, "/add/");
}
示例2: checkLogin
void Client::checkLogin(QString login)
{
QtSoapMessage request;
request.setMethod("ExistLogin");
request.addMethodArgument("login", "", login);
qDebug() << "Checking login: " << login;
http.submitRequest(request, "/add/");
}
示例3: Q_D
//----------------------------------------------------------------------------
const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodName,
const QList<QtSoapType*>& soapTypes )
{
Q_D(ctkSimpleSoapClient);
/*QString action="\"";
//action.append(methodName);
action.append("\"");
d->Http.setAction(action);*/
QString action = "http://dicom.nema.org/PS3.19/IHostService/" + methodName;
d->Http.setAction(action);
CTK_SOAP_LOG( << "Submitting action " << action
<< " method " << methodName
<< " to path " << d->Path );
QtSoapMessage request;
//request.setMethod(QtSoapQName(methodName,"http://wg23.dicom.nema.org/"));
request.setMethod(QtSoapQName(methodName,"http://dicom.nema.org/PS3.19" + d->Path ));
if(!soapTypes.isEmpty())
{
for (QList<QtSoapType*>::ConstIterator it = soapTypes.begin();
it < soapTypes.constEnd(); it++)
{
request.addMethodArgument(*it);
CTK_SOAP_LOG( << " Argument type added " << (*it)->typeName() << ". "
<< " Argument name is " << (*it)->name().name() );
}
}
CTK_SOAP_LOG_LOWLEVEL( << "Submitting request " << methodName);
CTK_SOAP_LOG_LOWLEVEL( << request.toXmlString());
d->Http.submitRequest(request, d->Path);;
CTK_SOAP_LOG_LOWLEVEL( << "Submitted request " << methodName);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
d->BlockingLoop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents);
QApplication::restoreOverrideCursor();
//qDebug() << "Reply error: " << reply->errorString();
//qDebug() << reply->readAll();
const QtSoapMessage& response = d->Http.getResponse();
CTK_SOAP_LOG( << "Got Response." );
if (response.isFault())
{
qCritical() << "ctkSimpleSoapClient: server error (response.IsFault())";
CTK_SOAP_LOG_LOWLEVEL( << response.faultString().toString().toLatin1().constData() << endl );
CTK_SOAP_LOG_LOWLEVEL( << response.toXmlString() );
return response.returnValue();
// throw ctkRuntimeException("ctkSimpleSoapClient: server error (response.IsFault())");
}
示例4: 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);
}
示例5: 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);
}
示例6: requestLogin
void TimeSpiderSettingsDialog::requestLogin( )
{
QtSoapMessage request;
request.setMethod( "request-login", SERVICE_NAMESPACE );
request.addMethodArgument( "email", "", email->text( ) );
request.addMethodArgument( "uid", "", getMacAddress( ) );
QString xml = request.toXmlString( );
qDebug( ) << "Sending SOAP request: " << xml;
m_soap.setHost( serviceHost->text( ), serviceUseSSL->isChecked( ), servicePort->value( ) );
m_soap.submitRequest( request, servicePath->text( ) );
QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
}
示例7: 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();
}
示例8: processNotifyDataAvailable
void ctkExchangeSoapMessageProcessor::processNotifyDataAvailable(
const QtSoapMessage &message, QtSoapMessage *reply) const
{
// extract arguments from input message
const QtSoapType& inputType = message.method()["data"];
const ctkDicomAppHosting::AvailableData data = ctkDicomSoapAvailableData::getAvailableData(inputType);
const QtSoapType& inputType2 = message.method()["lastData"];
const bool lastData = ctkDicomSoapBool::getBool(inputType2);
// query interface
bool result = exchangeInterface->notifyDataAvailable(data, lastData);
// set reply message
reply->setMethod("notifyDataAvailable");
QtSoapType* resultType = new ctkDicomSoapBool("dataAvailable",result);
reply->addMethodArgument(resultType);
}
示例9: buildInformResponse
void AcsMessageBuilder::buildInformResponse(const QString &id, QtSoapMessage &informResponse)
{
//Envelope
buildEnvelope(informResponse);
//Header
informResponse.header().insert(new QtSoapSimpleType(QtSoapQName(nsPrefix() + TAG_ID), id));
//Body
QtSoapStruct *pInformResponseStruct = new QtSoapStruct(QtSoapQName(nsPrefix() + INFORMRESPONSE));
pInformResponseStruct->insert(new QtSoapSimpleType(QtSoapQName(TAG_MAXENVELOPES), "1"));
QtSoapStruct& body = informResponse.body();
body.insert(pInformResponseStruct);
}
示例10: buildRebootRequest
void AcsMessageBuilder::buildRebootRequest(QtSoapMessage &request)
{
//Envelope
buildEnvelope(request);
//Header
QString id = "987654321";
request.header().insert(new QtSoapSimpleType(QtSoapQName(nsPrefix() + TAG_ID), id));
//Body
QtSoapStruct *pInformResponseStruct = new QtSoapStruct(QtSoapQName(nsPrefix() + TAG_REBOOT));
pInformResponseStruct->insert(new QtSoapSimpleType(QtSoapQName(TAG_COMMAND_KEY), "Reboot Method (ACS)"));
QtSoapStruct& body = request.body();
body.insert(pInformResponseStruct);
}
示例11: process
bool ctkAppSoapMessageProcessor::process(
const QtSoapMessage& message, QtSoapMessage* reply ) const
{
// TODO check for NULL appInterface?
const QtSoapType& method = message.method();
QString methodName = method.name().name();
qDebug() << "AppMessageProcessor: Received soap method request: " << methodName;
bool foundMethod = false;
if (methodName == "getState")
{
processGetState(message, reply);
foundMethod = true;
}
else if (methodName == "setState")
{
processSetState(message, reply);
foundMethod = true;
}
else if (methodName == "bringToFront")
{
processBringToFront(message, reply);
foundMethod = true;
}
return foundMethod;
}
示例12: process
//----------------------------------------------------------------------------
bool ctkExchangeSoapMessageProcessor::process(
const QtSoapMessage& message, QtSoapMessage* reply ) const
{
// TODO check for NULL exchangeInterface?
const QtSoapType& method = message.method();
QString methodName = method.name().name();
qDebug() << "ExchangeMessageProcessor: Received soap method request: " << methodName;
bool foundMethod = false;
if (methodName == "notifyDataAvailable")
{
processNotifyDataAvailable(message, reply);
foundMethod = true;
}
else if (methodName == "getData")
{
processGetData(message, reply);
foundMethod = true;
}
else if (methodName == "releaseData")
{
processReleaseData(message, reply);
foundMethod = true;
}
return foundMethod;
}
示例13: processNotifyStatus
void ctkHostSoapMessageProcessor::processNotifyStatus(
const QtSoapMessage &message, QtSoapMessage * /* reply */) const
{
// extract arguments from input message
const QtSoapType& inputType = message.method()["status"];
// query interface
hostInterface->notifyStatus(ctkDicomSoapStatus::getStatus(inputType));
// set reply message: nothing to be done
}
示例14: processNotifyStateChanged
void ctkHostSoapMessageProcessor::processNotifyStateChanged(
const QtSoapMessage &message, QtSoapMessage * /* reply */) const
{
// extract arguments from input message
const QtSoapType& inputType = message.method()[0];//["state"]; java sends ["newState"]; FIX JAVA/STANDARD
// query interface
hostInterface->notifyStateChanged(ctkDicomSoapState::getState(inputType));
// set reply message: nothing to be done
}
示例15: QObject
Easter::Easter(short year, QObject *parent)
: QObject(parent), http(this)
{
connect(&http, SIGNAL(responseReady(const QtSoapMessage &)),
this, SLOT(getResponse(const QtSoapMessage &)));
QtSoapMessage request;
request.setMethod("GetEaster",
"http://www.27seconds.com/Holidays/US/Dates/");
request.addMethodArgument("year", "", year);
http.setHost("www.27seconds.com");
http.setAction("http://www.27seconds.com/Holidays/US/Dates/GetEaster");
http.submitRequest(request, "/Holidays/US/Dates/USHolidayDates.asmx");
qDebug("Looking up the date of easter in %i...", year);
this->year = year;
}