gsoap,使用VC++使用开发Web服务(ISAPI extension - mod_gsoap.dll) 3-gSoap 乱码

在上一讲中已经实现gSoap WebService端,但是输入参数为中文字符串时,程序发生异常,修改客户端helloworldRequestBody方法的传入参数为helloworldRequestBody(“中华人民共和国”)
static void Main(string[] args)
{
try
{
ServiceReference1.ServicePortType s = new ServiceReference1.ServicePortTypeClient();
ServiceReference1.currentTimeResponse response1 = s.currentTime(new ServiceReference1.currentTimeRequest() );
ServiceReference1.helloworldRequest request2 = new ServiceReference1.helloworldRequest(new ServiceReference1.helloworldRequestBody("中华人民共和国"));
ServiceReference1.helloworldResponse response2 = s.helloworld(request2);
System.Console.WriteLine(response1.rsp);
System.Console.WriteLine(response2.Body.rsp);
}
catch (Exception exp)
{
System.Console.WriteLine(exp.Message);
}
}
编译并运行程序,程序发生异常如下图:
Tags:  vcgsoap gsoap实例 gsoap使用 gsoap文档 gsoap

延伸阅读

最新评论

发表评论