首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

gSoap客户端调用Webservice服务的有关问题,怎么保持长连接

2012-02-26 
gSoap客户端调用Webservice服务的问题,如何保持长连接?gSoap客户端通过SoapBindingProxy调用 webservice服

gSoap客户端调用Webservice服务的问题,如何保持长连接?
gSoap客户端通过SoapBindingProxy调用 webservice服务端的时候,跟踪代码发现每次调用完一个接口后,都要调用soap_closesock(soap),有没有方法不soap_closesock(soap),也就是保持长连接状态。

[解决办法]
受http协议限制,所以就是这样子了。
[解决办法]

探讨

19.11 TCP and HTTP Keep-Alive

gSOAP supports keep-alive socket connections. To activate keep-alive support, set the SOAP_IO_KEEPALIVE flag for both input and output modes, see Section 9.12. For e……

[解决办法]
19.11 TCP and HTTP Keep-Alive

 

[解决办法]
19.28 Client-Side Cookie Support

Client-side cookie support is optional. To enable cookie support, compile all sources with option -DWITH_COOKIES, for example: 

> c++ -DWITH_COOKIES -o myclient stdsoap2.cpp soapC.cpp soapClient.cpp

or add the following line to stdsoap.h: 

#define WITH_COOKIES

Client-side cookie support is fully automatic. So just (re)compile stdsoap2.cpp with -DWITH_COOKIES to enable cookie-based session control in your client.
A database of cookies is kept and returned to the appropriate servers. Cookies are not automatically saved to a file by a client. An example cookie file manager is included as an extras in the distribution. You should explicitly remove all cookies before terminating a gSOAP context by calling soap_free_cookies(soap) or by calling soap_done(soap).
To avoid "cookie storms" caused by malicious servers that return an unreasonable amount of cookies, gSOAP clients/servers are restricted to a database size that the user can limit (32 cookies by default), for example: 

struct soap soap; 
soap_init(&soap); 
soap.cookie_max = 10;
[解决办法]
请问楼主解决了吗? 给个答案,我也有这方面的问题。。。感谢。

热点排行