当前位置: 首页>>代码示例>>C++>>正文


C++ QtSoapMessage::setMethod方法代码示例

本文整理汇总了C++中QtSoapMessage::setMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ QtSoapMessage::setMethod方法的具体用法?C++ QtSoapMessage::setMethod怎么用?C++ QtSoapMessage::setMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QtSoapMessage的用法示例。


在下文中一共展示了QtSoapMessage::setMethod方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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/");
}
开发者ID:eduardovillasboas,项目名称:WebService,代码行数:8,代码来源:client.cpp

示例2: checkLogin

void Client::checkLogin(QString login)
{
    QtSoapMessage request;
    request.setMethod("ExistLogin");
    request.addMethodArgument("login", "", login);
    qDebug() << "Checking login: " << login;
    http.submitRequest(request, "/add/");
}
开发者ID:eduardovillasboas,项目名称:WebService,代码行数:8,代码来源:client.cpp

示例3: qCritical

//----------------------------------------------------------------------------
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())");
    }
开发者ID:151706061,项目名称:CTK,代码行数:58,代码来源:ctkSimpleSoapClient.cpp

示例4: setMethod

void dao::setMethod(QString method, QString authCodee) {
    QtSoapMessage request;
    request.setMethod(method, "http://public.qdkt.net.cn/public");
    request.addMethodArgument("Account", "", iaccount);
    if(method=="GetPassport")
        request.addMethodArgument("Password", "",authCodee);
    else
        request.addMethodArgument("AuthCode", "", authCodee);
    request.addMethodArgument("Flag", "true", true);
    request.addMethodArgument("Errmessage", "", "1");
    soap->setHost("10.200.255.0", 8080);
    soap->setAction("http://public.qdkt.net.cn/public/" + method);
    soap->submitRequest(request, "/public/pub.asmx");
}
开发者ID:Awesomez,项目名称:SdustFlux,代码行数:14,代码来源:dao.cpp

示例5: 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 ) );
}
开发者ID:Eurospider,项目名称:TimeSpider,代码行数:15,代码来源:TimeSpiderSettingsDialog.cpp

示例6: 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;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:18,代码来源:easter.cpp

示例7: connect

void
QtShanoirWebService::run()
{
    d->requestSuccess = true;
    QtSoapMessage request;
    request.setMethod(d->WsMethod, d->WsImpl);

    for (int i = 0; i < d->argname.count(); ++i)
        request.addMethodArgument(d->argname.at(i), "", d->argval.at(i));

    // Submit the request the the web service.
    QString host = QtShanoirSettings::Instance()->host();
    QString port = QtShanoirSettings::Instance()->port();

    d->http.setHost(host, true, port.toInt()); // set secure connection and port

    d->http.setAction(QString("https://%1//Shanoir-Shanoir/%2").arg(host).arg(d->WebService));
    d->http.submitRequest(d->req, request, "//Shanoir-Shanoir/" + d->WebService);

    QNetworkReply *nrep = d->http.networkReply();
    connect(nrep, SIGNAL(sslErrors ( const QList<QSslError> & )), this, SLOT(sslErrors ( const QList<QSslError> &)));
}
开发者ID:Inria-Visages,项目名称:QtShanoir,代码行数:22,代码来源:QtShanoirWebService.cpp

示例8: incomingControlRequest


//.........这里部分代码省略.........
    {
        service = m_deviceStorage.searchServiceByControlUrl(
            device, extractRequestExludingUdn(invokeActionRequest.serviceUrl()));
    }

    if (!service)
    {
        HLOG_WARN(QString("Ignoring invalid action invocation to: [%1].").arg(
            invokeActionRequest.serviceUrl().toString()));

        mi->setKeepAlive(false);

        m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
            BadRequest, *mi));

        return;
    }

    const QtSoapMessage* soapMsg = invokeActionRequest.soapMsg();
    const QtSoapType& method = soapMsg->method();
    if (!method.isValid())
    {
        HLOG_WARN("Invalid control method.");

        mi->setKeepAlive(false);

        m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
            BadRequest, *mi));

        return;
    }

    HServerAction* action = service->actions().value(method.name().name());

    if (!action)
    {
        HLOG_WARN(QString("The service has no action named [%1].").arg(
            method.name().name()));

        mi->setKeepAlive(false);
        m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
            *mi, UpnpInvalidArgs, soapMsg->toXmlString()));

        return;
    }

    HActionArguments iargs = action->info().inputArguments();
    HActionArguments::iterator it = iargs.begin();
    for(; it != iargs.end(); ++it)
    {
        HActionArgument iarg = *it;

        const QtSoapType& arg = method[iarg.name()];
        if (!arg.isValid())
        {
            mi->setKeepAlive(false);
            m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
                *mi, UpnpInvalidArgs, soapMsg->toXmlString()));

            return;
        }

        if (!iarg.setValue(
                HUpnpDataTypes::convertToRightVariantType(
                    arg.value().toString(), iarg.dataType())))
        {
            mi->setKeepAlive(false);
            m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
                *mi, UpnpInvalidArgs, soapMsg->toXmlString()));

            return;
        }
    }

    HActionArguments outArgs = action->info().outputArguments();
    qint32 retVal = action->invoke(iargs, &outArgs);
    if (retVal != UpnpSuccess)
    {
        mi->setKeepAlive(false);
        m_httpHandler->send(mi, HHttpMessageCreator::createResponse(
            *mi, retVal, soapMsg->toXmlString()));

        return;
    }

    QtSoapNamespaces::instance().registerNamespace(
        "u", service->info().serviceType().toString());

    QtSoapMessage soapResponse;
    soapResponse.setMethod(QtSoapQName(
        QString("%1%2").arg(action->info().name(), "Response"),
        service->info().serviceType().toString()));

    foreach(const HActionArgument& oarg, outArgs)
    {
        QtSoapType* soapArg =
            new SoapType(oarg.name(), oarg.dataType(), oarg.value());

        soapResponse.addMethodArgument(soapArg);
    }
开发者ID:Kangda,项目名称:Upnp-AV-Demo,代码行数:101,代码来源:hdevicehost_http_server_p.cpp

示例9: checkDb


//.........这里部分代码省略.........
                    QString f = func == "add" ? "addKey" : "removeKey" ;
                    p["userId"] = userId;
                    p["key"] = param3;
                    p["keyType"] = "01";

                    QString xmlFunc = CXmlFactory::deviceAction( deviceId ,f, p);
                    emit accessAction(xmlFunc);

                }

                if(type == "reason")
                {
                    QMap<QString, QString> p;
                    QString f = func == "add" ? "addAbsentReason" : "removeAbsentReason" ;
                    p["reasonId"] = reasonId;
                    p["text"] = param;
                    p["status"] = param2;
                    p["group"] = param2 == "1" ? "IN" : "OUT";
                    QString xmlFunc = CXmlFactory::deviceAction( deviceId, f, p);
                    emit accessAction(xmlFunc);

                }

                if(type == "balances")
                {
                    QMap<QString, QString> p;
                    QString f = "addUserBalances";
                    p["userId"] = userId;
                    p["balances"] = param;
                    QString xmlFunc = CXmlFactory::deviceAction( deviceId, f, p);
                    emit accessAction(xmlFunc);

                }

                if(type == "balancesText")
                {
                    QMap<QString, QString> p;
                    QString f = "setBalanceText";
                    p["fieldNo"] = param;
                    p["text"] = param2;
                    QString xmlFunc = CXmlFactory::deviceAction( deviceId, f, p);
                    emit accessAction(xmlFunc);

                }

                if(type == "reinit")
                {
                    QMap<QString, QString> p;
                    QString f = "reinit";
                    QString xmlFunc = CXmlFactory::deviceAction( deviceId, f, p);
                    emit accessAction(xmlFunc);
                }

                if(type == "load") {
                    QMap<QString, QString> p;
                    QString f = func == "add" ? "addBDEData" : "removeBDEData";

                    if(func == "add") {
                        p["BDEfieldNo"] = param;
                        p["value"] = param2;
                        p["valueText"] = param3;
                    } else {
                        p["BDEfieldNo"] = param;
                        p["value"] = param2;
                    }
                    QString xmlFunc = CXmlFactory::deviceAction( deviceId, f, p);
                    emit accessAction(xmlFunc);
                }

                ids << id;
            }

            if(saas && ids.count()>0)
            {
                QtSoapMessage message;
                message.setMethod("callServiceComponent");

                QtSoapArray *array = new QtSoapArray(QtSoapQName("params"));

                array->insert(0, new QtSoapSimpleType(QtSoapQName("component"),"timuxadmin"));
                array->insert(1, new QtSoapSimpleType(QtSoapQName("class"),"timuxAdminDevice"));
                array->insert(2, new QtSoapSimpleType(QtSoapQName("function"),"syncStandalone"));
                array->insert(3, new QtSoapSimpleType(QtSoapQName("params"),ids.join(",")));

                message.addMethodArgument(array);

                soapClient.submitRequest(message, saas_path+"/index.php?soap=soapComponent&password=" + saas_password + "&username=" + saas_username);
            }
            else
            {
                QSqlQuery queryDel("DELETE FROM hr_gantner_standalone_action WHERE deviceId=" + QString::number(i.key()) );
                timerCheckDb->start(TIME_DB_CHECKING);
            }

        }
    }

    if(!saas)
        QSqlQuery queryOptimize("OPTIMIZE TABLE hr_gantner_standalone_action");
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:101,代码来源:cgantnertime.cpp

示例10: isAccess


//.........这里部分代码省略.........
                        BDE4 +
                        "','" +
                        BDE5 +
                        "','" +
                        BDE6 +
                        "','" +
                        BDE7 +
                        "','" +
                        BDE8 +
                        "','" +
                        BDE9 +
                        "','" +
                        BDE10 +
                        "','" +
                        BDE11 +
                        "','" +
                        BDE12 +
                        "','" +
                        BDE13 +
                        "','" +
                        BDE14 +
                        "','" +
                        BDE15 +
                        "','" +
                        BDE16 +
                        "','" +
                        BDE17 +
                        "','" +
                        BDE18 +
                        "','" +
                        BDE19 +
                        "','" +
                        BDE20 +
                        "')"
                        );

            code = "255";


            //check the booking if it is a valid input
            trackingIdToCheck = lastTrackingId;

        } else {

            QSqlQuery query("INSERT INTO `hr_tracking` ( `id` , `id_user` , `id_key` , `time` , `date` , `id_entry` , `is_access` , `id_comment`, `key`, `extData` ) VALUES ('', '" +
                        userId +
                        "','" +
                        keyId +
                        "', '" + time +"', '" + date +"', '" +
                        deviceId +
                        "', '" +
                        "1" +
                        "', '" +
                        "0" +
                        "', '" +
                        key +
                        "', '" +
                        "hr_timux_booking"
                        "')"
                        );

            QSqlQuery lastTracking = "SELECT id FROM `hr_tracking` WHERE id_entry=" + deviceId + " AND id_user=" + userId + " ORDER BY id DESC LIMIT 0,1";
            lastTracking.next();
            lastTrackingId = lastTracking.value(0).toString();
        }

        QSqlQuery bookquery("INSERT INTO `hr_timux_booking` ( `tracking_id` , `action` , `actionReason`, `roundBooking` ) VALUES (" +
                    lastTrackingId +
                    "," +
                    code +
                    ",'" +
                    reason +
                    "','" +
                    roundBooking.toString("hh:mm:ss") +
                    "')"
                    );

        if(trackingIdToCheck != "") {
            QtSoapMessage message;
            message.setMethod("callServiceComponent");

            QtSoapArray *array = new QtSoapArray(QtSoapQName("params"));

            array->insert(0, new QtSoapSimpleType(QtSoapQName("component"),"timuxadmin"));
            array->insert(1, new QtSoapSimpleType(QtSoapQName("class"),"timuxAdminDevice"));
            array->insert(2, new QtSoapSimpleType(QtSoapQName("function"),"checkInputBDE"));
            array->insert(3, new QtSoapSimpleType(QtSoapQName("trackingId"),lastTrackingId));

            message.addMethodArgument(array);

            soapClientInputBDE.submitRequest(message, saas_path+"/index.php?soap=soapComponent&password=" + saas_password + "&username=" + saas_username);

            qDebug() << "Check the input BDE";
        }

        checkBalances(userId.toInt());
    }

    return true;
}
开发者ID:BackupTheBerlios,项目名称:horux-svn,代码行数:101,代码来源:cgantnertime.cpp

示例11: getAvailableScreen

QRect ctkDicomHostInterfaceImpl::getAvailableScreen(const QRect& preferredScreen)
{
  http.setAction("GetAvailableScreen");

  QtSoapMessage request;
  request.setMethod("GetAvailableScreen");

  QtSoapStruct* preferredScreenType = new QtSoapStruct(QtSoapQName("preferredScreen"));
  preferredScreenType->insert(new QtSoapSimpleType(QtSoapQName("Height"), preferredScreen.height()));
  preferredScreenType->insert(new QtSoapSimpleType(QtSoapQName("Width"), preferredScreen.width()));
  preferredScreenType->insert(new QtSoapSimpleType(QtSoapQName("RefPointX"), preferredScreen.x()));
  preferredScreenType->insert(new QtSoapSimpleType(QtSoapQName("RefPointY"), preferredScreen.y()));

  request.addMethodArgument(preferredScreenType);

  http.submitRequest(request, "/IHostService");

  qDebug() << "Submitted request GetAvailableScreen";

  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));

  blockingLoop.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents);

  QApplication::restoreOverrideCursor();

  //qDebug() << "Reply error: " << reply->errorString();
  //qDebug() << reply->readAll();
  const QtSoapMessage& response = http.getResponse();

  if (response.isFault())
  {
    throw std::runtime_error("server error");
  }

  qDebug() << "Response: " << response.toXmlString();

  const QtSoapType &meth = response.method();

  if (!meth.isValid() || meth.type() != QtSoapType::Struct)
    qDebug() << "SOAP returning NIL: invalid or type != Struct";

  const QtSoapStruct &m = dynamic_cast<const QtSoapStruct &>(meth);
  if (m.count() == 0)
    qDebug() << "SOAP returning NIL: count == 0";


  const QtSoapType& screenResult = response.returnValue();
  if (!screenResult.isValid())
  {
    //throw std::runtime_error("invalid return value");
    qDebug() << response.errorString() << response.faultString().toString();
    qDebug() << response.toXmlString();
    return QRect();
  }

  qDebug() << screenResult.count() << screenResult["Height"].typeName();
  QRect resultRect;
  resultRect.setHeight(screenResult["Height"].toInt());
  resultRect.setWidth(screenResult["Width"].toInt());
  resultRect.setX(screenResult["RefPointX"].toInt());
  resultRect.setY(screenResult["RefPointY"].toInt());

  qDebug() << "x:" << resultRect.x() << " y:" << resultRect.y();

  return resultRect;
}
开发者ID:,项目名称:,代码行数:66,代码来源:

示例12: url

KEcm::KEcm()
{  
    QLabel* l = new QLabel( this );
    l->setText( "Hello World!" );
    setCentralWidget( l );
    KAction* a = new KAction(this);
    a->setText( "Quit" );
    connect(a, SIGNAL(triggered()), SLOT(close()) );
    
      menubar = new KMenuBar;
    menubar->addMenu("File" )->addAction( a );
    
    setMenuBar(menubar);
    KAction* autenticacao = new KAction(this);
    autenticacao->setText( ki18n("&WebServices").toString() );
    connect(autenticacao, SIGNAL(triggered()), SLOT(ecmConfigure()) );
        
    menubar->addMenu( ki18n("&Configurações").toString() )->addAction( autenticacao );    
    
    connect(&http, SIGNAL(responseReady(const QtSoapMessage &)),
            this, SLOT(getResponse(const QtSoapMessage &)));
    
    connect(http.networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
             this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
    
    QtSoapMessage request;
    
    request.setMethod("DocInfoByName", "http://www.stellent.com/DocInfo");
        
   
    request.addMethodArgument("dDocName", "http://www.stellent.com/DocInfo", "CSNOTE16200000201");
     
    // Submit the request the the web service.    
    http.setHost("csnote",false,16200);
    http.setAction("http://csnote:16200/_dav/cs/idcplg/DocInfo");
    
    http.submitRequest(request, "_dav/cs/idcplg/DocInfo?WSDL");
    //std::cout << request.toXmlString().toStdString() << "\n\n\n";
   // delete type;
    /*
    request.setMethod("GetEaster",
		      "http://www.27seconds.com/Holidays/US/Dates/");
    request.addMethodArgument("year", "", 10);

    http.setHost("www.27seconds.com");
    http.setAction("http://www.27seconds.com/Holidays/US/Dates/GetEaster");
    http.submitRequest(request, "/Holidays/US/Dates/USHolidayDates.asmx");*/
    /*
    std::cout << "tt " << request.errorString().toStdString() << endl;
    std::cout << "tt " << request.returnValue().toString().toStdString() << "\n\n" << endl;
    std::cout << request.toXmlString().toStdString() << "\n\n\n";
    
    
    
    qDebug("passou");
    
    // create and show your widgets here
    const QtSoapMessage &message = http.getResponse();
    std::cout << message.returnValue().toString().toStdString();
    // Check if the response is a SOAP Fault message
    if (message.isFault()) {
        qDebug("Error: %s", message.faultString().value().toString().toLatin1().constData());
    }
    else {
      std::cout <<  message.toXmlString().toStdString() ;
        // Get the return value, and print the result.
        const QtSoapType &response = message.returnValue();
        qDebug("%s Teste",
               response["DocInfoByNameResult"].value().toString().toLatin1().constData());
    }
    
    QUrl url("http://csnote:16200/_dav/cs/idcplg/DocInfo?WSDL");
    QNetworkRequest request(url);
    QNetworkAccessManager *qnam  = new QNetworkAccessManager(this);;
    
    
    connect(qnam, SIGNAL(finished(QNetworkReply*)),
             this, SLOT(httpFinished(QNetworkReply*)));
   connect(qnam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
             this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
   
   
   QByteArray arr;
   arr.append("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:doc=\"http://www.stellent.com/DocInfo/\">");
   arr.append("<soapenv:Header>");
   arr.append("</soapenv:Header>");
   arr.append("<soapenv:Body>");
    arr.append("<doc:DocInfoByName>");
      arr.append("<doc:dDocName>CSNOTE16200000201</doc:dDocName>");
    arr.append("</doc:DocInfoByName>");
   arr.append("</soapenv:Body>");
   arr.append("</soapenv:Envelope>");
   
   request.setHeader(QNetworkRequest::ContentTypeHeader,"text/xml");
   
   
   qnam->post(request,arr);*/
   
}
开发者ID:cassioarmy,项目名称:KEcm,代码行数:99,代码来源:KEcm.cpp


注:本文中的QtSoapMessage::setMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。