本文整理汇总了C++中CMultiXAppMsg::IsWebServiceCall方法的典型用法代码示例。如果您正苦于以下问题:C++ CMultiXAppMsg::IsWebServiceCall方法的具体用法?C++ CMultiXAppMsg::IsWebServiceCall怎么用?C++ CMultiXAppMsg::IsWebServiceCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMultiXAppMsg
的用法示例。
在下文中一共展示了CMultiXAppMsg::IsWebServiceCall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CMultiXWSServerServerSession::OnNewMsg(CMultiXAppMsg &Msg)
{
DebugPrint(1,"New Message Received\n");
if(!Msg.IsWebServiceCall())
{
DebugPrint(1,"Error Reply TpmErrMsgNotSupported\n");
Msg.Reply(TpmErrMsgNotSupported);
return;
}
try
{
if(m_pStream == NULL)
m_pStream = new CMultiXWSStream(Msg.WSDllFile(),*this);
bool bSuccess = m_pStream->CallServiceNoWait(Msg);
if(!bSuccess)
{
Owner()->Logger()->ReportError(DebugPrint(0,"Error on CallServiceNoWait\n"));
Msg.Reply(WSErrgSoapDllNotFound);
}
}catch(...)
{
DebugPrint(1,"Error Reply WSErrgSoapDllNotFound\n");
Msg.Reply(WSErrgSoapDllNotFound);
}
}
示例2:
CMultiXLayer::EventHandlerReturn CMultiXWSStream::OnNewRequestMessage(CMultiXEvent *Event)
{
CMultiXWSStreamEvent *Ev = (CMultiXWSStreamEvent *)Event;
// if we have a valid message saved, we reply it with error - this will happen only if we have not replied to it before
// we will also delete the message, since we do not need it any more.
CMultiXAppMsg *pMsg = m_RequestMsgID.GetObject();
if(pMsg != NULL)
{
pMsg->Reply(TpmErrMsgCanceled);
delete pMsg;
}
m_RequestMsgID = Ev->m_MsgID;
pMsg = m_RequestMsgID.GetObject();
if(pMsg == NULL)
return CMultiXLayer::DeleteEvent;
bool bExit = false;
while(!bExit) // we do a "while" here just so we can fall thru the end of function and delete the message object
{
bExit = true;
if(!pMsg->IsWebServiceCall())
{
pMsg->Reply(TpmErrMsgNotSupported);
break;
}
std::string FuncName;
std::string DLLName;
EXPORTABLE_STL::map<int32_t,std::string>::iterator It = m_MsgCodeToFunctionMap.find(pMsg->MsgCode());
if(It != m_MsgCodeToFunctionMap.end())
{
DLLName = It->second.substr(0,It->second.find("|||"));
FuncName = It->second.substr(It->second.find("|||")+3);
}
else
{
DLLName = pMsg->WSDllFile();
FuncName = pMsg->WSDllFunction();
}
try
{
InitgSoap(DLLName);
} catch(...)
{
pMsg->Reply(WSErrgSoapDllNotFound);
break;
}
TgSoapServiceFunction Func = (TgSoapServiceFunction)GetProcAddress(m_pFunctions->m_pDLLHandle,FuncName.c_str());
if(Func == NULL)
{
pMsg->Reply(WSErrServiceFunctionNotFound);
break;
} else if(It == m_MsgCodeToFunctionMap.end())
{
m_MsgCodeToFunctionMap[pMsg->MsgCode()] = DLLName + "|||" + pMsg->WSDllFunction();
}
ResetData();
if(m_pInBuf)
m_pInBuf->ReturnBuffer();
m_pInBuf = pMsg->Owner()->Owner()->AllocateBuffer(pMsg->AppData(),pMsg->AppDataSize());
int Error = Func(gSoap());
if(OutBuf().Length() > 0)
{
pMsg->Reply(pMsg->MsgCode(),OutBuf());
} else
{
pMsg->Reply(Error);
}
}
if(pMsg)
delete pMsg;
m_RequestMsgID.Init();
return CMultiXLayer::DeleteEvent;
}