对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() { }
};