gSOAP能异步调用webservice吗?

my_aa 2011-11-09 04:46:34
能的话,请给个具体代码例子参考下,谢谢!
...全文
388 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
qianwen36 2014-03-21
  • 打赏
  • 举报
回复
引用 1 楼 yisiyou 的回复:
这个不知道,支持下!
会令我嘲笑你们的,楼主肯定问的是IO异步,而不是另外去搞什么增加线程调用来搞什么异步。人家要的是处理网络IO时实现事件机制的接收。 那一砣代码,有多用处啊。别忽弄新人啊
yynetsdk 2011-11-14
  • 打赏
  • 举报
回复
本身同步,可以用多线程实现异步
masterz 2011-11-13
  • 打赏
  • 举报
回复
How do I declare a service method for one-way asynchronous messages?
Specify a 'void' output parameter in the service method function prototype, as in 'int ns__method(..., void);'. gSOAP will produce the client-side send and receive routines 'int soap_send_ns__method(struct soap*, ...)' and 'int soap_recv_ns__method(struct soap *, struct ns__method *)', respectively. In addition, the server-side service routine 'int soap_serve(struct soap*)' will accept one-way messages without returning a response.
my_aa 2011-11-10
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 oyljerry 的回复:]
可以放到线程中来实现异步
[/Quote]
大侠能否举个具体例子学习
sdbus 2011-11-10
  • 打赏
  • 举报
回复
可以.
static UINT ThreadToWS(LPVOID lParam)
{
ASSERT(lParam);
if(NULL == lParam)
{
return 0;
}

char m_EndPoint[MAX_PATH] = {0};
struct soap s;
soap_set_mode(&s, SOAP_C_UTFSTRING);
CWnd* pDlg = (CWnd*)lParam;

CWifiConfig cfg;
TCHAR szAddr[100];
memset(szAddr, 0, sizeof(szAddr));
cfg.Read(_T("Wifi"), _T("IECheck"), szAddr, 99);

CString strUrl = szAddr;
WideCharToMultiByte(CP_ACP,WC_COMPOSITECHECK,strUrl,strUrl.GetLength(),m_EndPoint,sizeof(m_EndPoint),NULL,NULL);
if(pDlg->IsKindOf(RUNTIME_CLASS(CDlgCheck)))
{
CDlgCheck* pTemp = (CDlgCheck*)lParam;
ns6__hhtLogin query;
ns6__hhtLoginResponse queryResponse;
query.arg0 = pTemp->m_szUser.GetBuffer(0);
query.arg1 = pTemp->m_szPwd.GetBuffer(0);//日期
int iResult = soap_call___ns6__hhtLogin(&s, m_EndPoint,NULL, &query,&queryResponse);
if(iResult == 0)
{
SendMessage(pDlg->m_hWnd,WM_QUERY_OVER,0,(LPARAM)&queryResponse);
}
else
{
SendMessage(pDlg->m_hWnd,WM_QUERY_OVER,1,iResult);
}
}

}
oyljerry 2011-11-09
  • 打赏
  • 举报
回复
可以放到线程中来实现异步
yisiyou 2011-11-09
  • 打赏
  • 举报
回复
这个不知道,支持下!

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧