本文整理汇总了C++中KDSoapMessage::setFault方法的典型用法代码示例。如果您正苦于以下问题:C++ KDSoapMessage::setFault方法的具体用法?C++ KDSoapMessage::setFault怎么用?C++ KDSoapMessage::setFault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDSoapMessage
的用法示例。
在下文中一共展示了KDSoapMessage::setFault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeCall
void KDSoapServerSocket::makeCall(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage &requestMsg, KDSoapMessage& replyMsg, const KDSoapHeaders& requestHeaders, const QByteArray& soapAction, const QString& path)
{
Q_ASSERT(serverObjectInterface);
//const QString method = requestMsg.name();
if (requestMsg.isFault()) {
// Can this happen? Getting a fault as a request !? Doesn't make sense...
// reply with a fault, but we don't even know what main element name to use
// Oh well, just use the incoming fault :-)
replyMsg = requestMsg;
handleError(replyMsg, "Client.Data", QString::fromLatin1("Request was a fault"));
} else {
// Call method on m_serverObject
serverObjectInterface->setRequestHeaders(requestHeaders, soapAction);
KDSoapServer* server = m_owner->server();
if (path != server->path()) {
serverObjectInterface->processRequestWithPath(requestMsg, replyMsg, soapAction, path);
} else {
serverObjectInterface->processRequest(requestMsg, replyMsg, soapAction);
}
if (serverObjectInterface->hasFault()) {
//qDebug() << "Got fault!";
replyMsg.setFault(true);
serverObjectInterface->storeFaultAttributes(replyMsg);
}
}
}
示例2: handleError
void KDSoapServerSocket::handleError(KDSoapMessage &replyMsg, const char *errorCode, const QString &error)
{
qWarning("%s", qPrintable(error));
replyMsg.setFault(true);
replyMsg.addArgument(QString::fromLatin1("faultcode"), QString::fromLatin1(errorCode));
replyMsg.addArgument(QString::fromLatin1("faultstring"), error);
}
示例3: processRequest
void KDSoapServerObjectInterface::processRequest(const KDSoapMessage &request, KDSoapMessage& response, const QByteArray& soapAction)
{
const QString method = request.name();
qDebug() << "Slot not found:" << method << "[soapAction =" << soapAction << "]" /* << "in" << metaObject()->className()*/;
response.setFault(true);
response.addArgument(QString::fromLatin1("faultcode"), QString::fromLatin1("Server.MethodNotFound"));
response.addArgument(QString::fromLatin1("faultstring"), QString::fromLatin1("%1 not found").arg(method));
}
示例4: processRequestWithPath
void KDSoapServerObjectInterface::processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path)
{
Q_UNUSED(soapAction);
const QString method = request.name();
qWarning("Invalid path: \"%s\"", qPrintable(path));
//qWarning() << "Invalid path:" << path << "[method =" << method << "; soapAction =" << soapAction << "]" /* << "in" << metaObject()->className()*/;
response.setFault(true);
response.addArgument(QString::fromLatin1("faultcode"), QString::fromLatin1("Client.Data"));
response.addArgument(QString::fromLatin1("faultstring"), QString::fromLatin1("Method %1 not found in path %2").arg(method, path));
}