https客户端以VC ++连接IIS Web服务器 [英] https client to connect IIS web server in VC++

查看:226
本文介绍了https客户端以VC ++连接IIS Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直试图在VC ++中使用https连接.net Web服务(IIS).
我试图通过向项目添加添加Web引用..."来使用CSoapSocketClientT,发现AtlHttpClient仅支持HTTP.

而且我也尝试整合
中的示例代码 "http://msdn.microsoft.com/zh-cn/library/s2ya483s(v=vs.80).aspx"

无法成功创建Web服务实例时出现错误

服务:: CServices< csoapwininetclient> srv;

编译错误是
错误C2143:语法错误:在"<''之前缺少;""


请帮助我解决该错误或示例项目,以使https客户端连接VC ++中的IIS Web服务器.

Hi All,

I have been trying to connect .net web service(IIS) using https in VC++.
I have tried to use CSoapSocketClientT by adding "Add web reference..." to the project and found that the AtlHttpClient support only HTTP.

And also I have tried to intergrate the sample code available in
"http://msdn.microsoft.com/en-us/library/s2ya483s(v=vs.80).aspx"

Could not successed as getting error in creating the instance for web service as

Services::CServices<csoapwininetclient> srv;

error in compile is,
"error C2143: syntax error : missing '';'' before ''<''"


Please help me resolve this error or sample project for https client to connect IIS web server in VC++.

推荐答案

我尝试用错误的方式创建实例

按照下面的链接,在创建实例时,在sproxy.exe生成的头文件中需要放置"CSoapWininetClient".通过这种方式,我现在可以成功连接http和https.

http://flylib.com/bo.../1.572.1.153/1/




sproxy.exe生成的标头包含上述模板的特化:

typedef CMyServiceT< csoapsocketclientt>> > CMyService;

大多数应用程序将CMyService用作代理类,即基于CSoapSocketClientT HTTP客户端(ATL Server附带的轻量级SOAP HTTP客户端)的专业化.但是,在实例化SOAP代理时,可以通过传递不同的模板参数来使用不同的HTTP堆栈. ATL Server中提供了两个基于WinINet和ServerXMLHTTP库的备用HTTP堆栈.它们是CSoapWininetClient(使用WinINet)和CSoapMSXMLInetClient(使用ServerXMLHTTP,MSXML 3.0或更高版本随附).要使用这些类,您将必须更改典型的客户端代码,如下所示:

CMyService soapProxy;并使其如下所示:

CMyServiceT< csoapwininetclient> soapProxy;
I had tried in wrong way to create a instance

As per the below link,in sproxy.exe generated header file need to place "CSoapWininetClient" while creating instance.By this way now iam able to connect http and https successfully.

http://flylib.com/bo.../1.572.1.153/1/




the sproxy.exe-generated header contains a specialization of the preceding template:

typedef CMyServiceT<csoapsocketclientt><> > CMyService;

Most applications use CMyService as a proxy class "that is, the specialization based on the CSoapSocketClientT HTTP client, the lightweight SOAP HTTP client that comes with ATL Server. However, you can use different HTTP stacks by passing different template parameters when instantiating the SOAP proxy. Two such alternate HTTP stacks, based on the WinINet and ServerXMLHTTP libraries, are available in ATL Server. They are CSoapWininetClient (using WinINet) and CSoapMSXMLInetClient (using ServerXMLHTTP, which comes with MSXML 3.0 or higher). To use these classes, you ll have to change the typical client code, which looks like this:

CMyService soapProxy; and make it look like this:

CMyServiceT<csoapwininetclient> soapProxy;


这篇关于https客户端以VC ++连接IIS Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆