对GSOAP熟的请进,如何获取gsoap返回值?

Eway5 2015-06-01 11:51:17
自己研究出来了:wprintf(L"%s ",res.outpara);
但发现中文乱码,加上:#include <Locale.h>
_wsetlocale(LC_ALL, L"chs");
输出我要的结果,一切OK!
由于论坛设置自己只能连续回帖3次,所以没办法加在后边,只好加上帖子开头。
现在的CSDN论坛怎么啦?以前都是抢着回答问题啊。。。
________________________________________________________________________
通过GSOAP调用C#写的WEBSERVICE服务:
const char* server = "http://127.0.0.1/webservice1.asmx?WSDL";
WxPaySoapProxy proxy(server, SOAP_C_UTFSTRING);
_ns1__ProcessData req;
_ns1__ProcessDataResponse res;
req.username = L"myname";
req.pwd = L"mypwd";
if (proxy.ProcessData(&req, res) == SOAP_OK)
{
wchar_t* o= res.outpara;
int r = res.rtn;
wchar_t* e = res.errormsg;
wchar_t* w = res.wxresult;
return 0;
}
——————————————————————————————————————————
现res的返回值为:outpara=0x0020d8e0 L"1,,1," rtn=0 errormsg=0x0020d650 L"";
o的值为0x0020d8e0;
请问:如何才能让o=L"1,,1,"?


——————————————————————————————————————————
以下为_ns1__ProcessDataResponse的定义:

class SOAP_CMAC _ns1__ProcessDataResponse
{
public:
wchar_t *outpara; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type xsd:string */
int rtn; /* required element of type xsd:int */
wchar_t *errormsg; /* optional element of type xsd:string */
wchar_t *wxresult; /* optional element of type xsd:string */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 8; } /* = unique type id SOAP_TYPE__ns1__ProcessDataResponse */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
_ns1__ProcessDataResponse() { _ns1__ProcessDataResponse::soap_default(NULL); }
virtual ~_ns1__ProcessDataResponse() { }
};
...全文
186 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Eway5 2015-06-01
  • 打赏
  • 举报
回复
给个解决问题的方向也可以。。。
Eway5 2015-06-01
  • 打赏
  • 举报
回复
大神都去炒股去了?
Eway5 2015-06-01
  • 打赏
  • 举报
回复
C++论坛这么没人气吗?

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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