Visual Studio 2010 SOAP 服务引用仅返回空值 [英] Visual Studio 2010 SOAP service reference returns only null values

查看:25
本文介绍了Visual Studio 2010 SOAP 服务引用仅返回空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Visual Studio 2010 的添加服务引用"工具生成的客户端为调用任何远程函数返回空值.
服务器是一个 Perl CGI 脚本 (SOAP::Transport::HTTP::CGI),我知道通过与其他客户端的测试可以正常运行.我使用 POD::WSDL 生成添加服务引用"所需的 WSDL 文件.

A client generated using Visual Studio 2010's 'Add Service Reference' tool returns a null value for calls to any remote function.
The server is a Perl CGI script (SOAP::Transport::HTTP::CGI) that I know is functioning correctly through testing with other clients. I used POD::WSDL to generate the WSDL file that the 'Add Service Reference' requires.

我已经确认服务器正在从客户端获取消息并返回适当的结果,这使我得出结论,客户端配置或 .NET 的 XML 解析器中存在一些缺陷.不会抛出任何错误,我也不会在调用客户端的应用程序中尝试任何棘手的事情.

I have confirmed that the server is getting messages from the client and returning the appropriate results which has lead me to conclude that there is some flaw in either the client configuration or in .NET's XML parser. No errors are thrown and I don't try anything tricky in the application that invokes the client.

有人遇到过这个问题吗?或者知道如何获取 XMLSerializer 的调试信息?WSDL 文件是否可以描述正确发送的方式,但不能描述如何解释响应?

Has anyone had this problem before? Or know how to get at debugging information for XMLSerializer? Could the WSDL file be describing the means to send correctly but not how to interpret the response?

Service.ServiceHandlerClient 客户端 = new Service.ServiceHandlerClient("ARMService", "https://domain/server_soap");
string wut = client.cat_test("a", "b");//应该返回a b"
Console.WriteLine("结果:" + wut );//始终为空!

Service.ServiceHandlerClient client = new Service.ServiceHandlerClient("ARMService", "https://domain/server_soap");
string wut = client.cat_test("a", "b"); // should return "a b"
Console.WriteLine("results: " + wut ); // is always null!

推荐答案

我为此找到了多么悲惨的解决方案:

What a miserable solution I've found for this:

在添加服务引用"向导中,添加 Web 服务"底部有一个按钮,可生成另一个立即起作用的实用程序.这只会留下一个问题,即为什么另一个向导会生成一个适用于大部分功能而非全部功能的代理.

In the 'Add Service Reference' wizard there is a button at the bottom 'Add Web Service' that spawns another utility that worked immediately. This only leaves the question of why the other wizard would produce a proxy that works for most of the functionality but not all of it.

这篇关于Visual Studio 2010 SOAP 服务引用仅返回空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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