c++怎么调用c#的webservice?
编程乐趣 .Net领域优质创作者 2011-07-11 06:28:08 用c++写的ATL程序调用c#的webservice,需要添加什么组件吗?
在网上看到资料,有提到要使用soapsdk。
我的代码:
// 因为生成的代码是基于ATL的,所以要初始化COM
::CoInitialize(NULL);
OutputDebugString(L"hel");
CWebService web = CWebService();
CComBSTR bstr;
HRESULT hr = web.HelloWorld(&bstr);
if (SUCCEEDED(hr))
{
OutputDebugString(L"success");
}
else
{
OutputDebugString(L"faild");
}
OutputDebugString(bstr);