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


C++ KDSoapMessage::faultAsString方法代码示例

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


在下文中一共展示了KDSoapMessage::faultAsString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: kWarning

void FetchEntryJob::Private::getEntryError(const KDSoapMessage &fault)
{
    if (!q->handleLoginError(fault)) {
        kWarning() << "Fetch Entry Error:" << fault.faultAsString();

        q->setError(SugarJob::SoapError);
        q->setErrorText(fault.faultAsString());
        q->emitResult();
    }
}
开发者ID:krf,项目名称:FatCRM,代码行数:10,代码来源:fetchentryjob.cpp

示例2: testInvalidXML

 void testInvalidXML()
 {
     HttpServerThread server(QByteArray(xmlEnvBegin11()) + "><soap:Body><broken></xml></soap:Body>", HttpServerThread::Public);
     KDSoapClientInterface client(server.endPoint(), QString::fromLatin1("urn:msg"));
     KDSoapMessage message;
     KDSoapMessage ret = client.call(QLatin1String("Method1"), message);
     QVERIFY(ret.isFault());
     QCOMPARE(ret.faultAsString(), QString::fromLatin1(
                  "Fault code 3: XML error: [1:354] Opening and ending tag mismatch."));
 }
开发者ID:cjh1,项目名称:KDSoap,代码行数:10,代码来源:builtinhttp.cpp

示例3: testFault

 void testFault() // HTTP error, creates fault on client side
 {
     HttpServerThread server(QByteArray(), HttpServerThread::Public | HttpServerThread::Error404);
     KDSoapClientInterface client(server.endPoint(), QString::fromLatin1("urn:msg"));
     KDSoapMessage message;
     KDSoapMessage ret = client.call(QLatin1String("Method1"), message);
     QVERIFY(ret.isFault());
     QCOMPARE(ret.faultAsString(), QString::fromLatin1(
                  "Fault code 203: Error downloading %1 - server replied: Not Found").arg(server.endPoint()));
 }
开发者ID:cjh1,项目名称:KDSoap,代码行数:10,代码来源:builtinhttp.cpp

示例4: testInvalidUndefinedEntityXML

 void testInvalidUndefinedEntityXML()
 {
     HttpServerThread server(QByteArray(xmlEnvBegin11()) + "><soap:Body>&doesnotexist;</soap:Body>" + xmlEnvEnd() + '\n', HttpServerThread::Public);
     KDSoapClientInterface client(server.endPoint(), QString::fromLatin1("urn:msg"));
     KDSoapMessage message;
     KDSoapMessage ret = client.call(QLatin1String("Method1"), message);
     QVERIFY(ret.isFault());
     QCOMPARE(ret.faultAsString(), QString::fromLatin1(
                  "Fault code 3: XML error: [1:291] Entity 'doesnotexist' not declared."));
 }
开发者ID:hporten,项目名称:KDSoap,代码行数:10,代码来源:builtinhttp.cpp

示例5: sendReply

void KDSoapServerSocket::sendReply(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage& replyMsg)
{
    const bool isFault = replyMsg.isFault();

    QByteArray xmlResponse;
    if (!replyMsg.isNull()) {
        KDSoapMessageWriter msgWriter;
        // Note that the kdsoap client parsing code doesn't care for the name (except if it's fault), even in
        // Document mode. Other implementations do, though.
        QString responseName = isFault ? QString::fromLatin1("Fault") : replyMsg.name();
        if (responseName.isEmpty())
            responseName = m_method;
        QString responseNamespace = m_messageNamespace;
        KDSoapHeaders responseHeaders;
        if (serverObjectInterface) {
            responseHeaders = serverObjectInterface->responseHeaders();
            if (!serverObjectInterface->responseNamespace().isEmpty()) {
                responseNamespace = serverObjectInterface->responseNamespace();
            }
        }
        msgWriter.setMessageNamespace(responseNamespace);
        xmlResponse = msgWriter.messageToXml(replyMsg, responseName, responseHeaders, QMap<QString, KDSoapMessage>());
    }

    const QByteArray response = httpResponseHeaders(isFault, "text/xml", xmlResponse.size());
    if (m_doDebug) {
        qDebug() << "KDSoapServerSocket: writing" << response << xmlResponse;
    }
    qint64 written = write(response);
    Q_ASSERT(written == response.size()); // Please report a bug if you hit this.
    written = write(xmlResponse);
    Q_ASSERT(written == xmlResponse.size()); // Please report a bug if you hit this.
    Q_UNUSED(written);
    // flush() ?

    // All done, check if we should log this
    KDSoapServer* server = m_owner->server();
    const KDSoapServer::LogLevel logLevel = server->logLevel(); // we do this here in order to support dynamic settings changes (at the price of a mutex)
    if (logLevel != KDSoapServer::LogNothing) {
        if (logLevel == KDSoapServer::LogEveryCall ||
                (logLevel == KDSoapServer::LogFaults && isFault)) {

            if (isFault)
                server->log("FAULT " + m_method.toLatin1() + " -- " + replyMsg.faultAsString().toUtf8() + '\n');
            else
                server->log("CALL " + m_method.toLatin1() + '\n');
        }
    }
}
开发者ID:nbeudez,项目名称:KDSoap,代码行数:49,代码来源:KDSoapServerSocket.cpp

示例6: main

int main(int argc, char **argv)
{
    QCoreApplication app(argc, argv);

    const int year = 2009;

    const QString endPoint = QLatin1String("http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx");
    const QString messageNamespace = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/");
    KDSoapClientInterface client(endPoint, messageNamespace);

    KDSoapMessage message;
    message.setQualified(true);
    message.addArgument(QLatin1String("year"), year);

    qDebug("Looking up the date of Valentine's Day in %i...", year);

    KDSoapMessage response = client.call(QLatin1String("GetValentinesDay"), message);
    if (response.isFault())
        printf("%s\n", qPrintable(response.faultAsString()));
    else
        printf("%s\n", qPrintable(response.arguments()[0].value().toString()));

    return 0;
}
开发者ID:Augus-Wang,项目名称:KDSoap,代码行数:24,代码来源:holidays.cpp


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