C# '反序列化操作的回复消息正文时出错......' - 对于我调用的每个方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10259778/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 13:04:14  来源:igfitidea点击:

'Error in deserializing body of reply message for operation ...' - for every method that i call

c#.netwcfweb-servicessoap

提问by Booyaches

I am trying to create very simple client application for our Polish auction service called Allegro. They provide API in SOAP architecture. The problem is that, every time I try to call any of the methods, I receive:

我正在尝试为我们名为 Allegro 的波兰拍卖服务创建非常简单的客户端应用程序。他们在 SOAP 架构中提供 API。问题是,每次我尝试调用任何方法时,我都会收到:

Error in deserializing body of reply message for operation 'name of method'

反序列化操作“方法名称”的回复消息正文时出错

I am new to web services in general so I have no idea how to find the source of the problem. I am absolutely sure that I am passing correct arguments to the method in the example below:

我一般是 Web 服务的新手,所以我不知道如何找到问题的根源。我绝对确定我正在向以下示例中的方法传递正确的参数:

class Program
{

    static void Main(string[] args)
    {
        string ALLEGRO_KEY = "******";
        AllegroWebAPI.AllegroWebApiPortTypeClient allegro = new AllegroWebApiPortTypeClient();
        long version = 0;
        String versionStr = allegro.doQuerySysStatus(out version, 1, 1, ALLEGRO_KEY);

    }
}

I am using .NET 4.0 in Visual Studio 2010. I know that there are many people using this API with .NET, even Allegro itself has official Windows Phone 7 client that uses this API. How can I troubleshoot that?

我在 Visual Studio 2010 中使用 .NET 4.0。我知道有很多人在 .NET 中使用这个 API,甚至 Allegro 本身也有使用这个 API 的官方 Windows Phone 7 客户端。我该如何解决这个问题?

Here is the WSDL address:

这是 WSDL 地址:

https://webapi.allegro.pl/uploader.php?wsdl

https://webapi.allegro.pl/uploader.php?wsdl

采纳答案by binarytree

I have had similiar problem. See your inner exception. I resolved it by extending the size of readerQuotas in web.config :)

我有类似的问题。看到你内心的例外。我通过在 web.config 中扩展 readerQuotas 的大小来解决它:)

回答by tom redfern

It sounds like there is something in the response message from the Web Service which WCF is having difficulty understanding.

听起来 WCF 难以理解来自 Web 服务的响应消息中的某些内容。

Configure WCF Tracingwith both service and message tracing enabled. This should give you the actual response message from the web service and will also give you more detailed error messages.

在启用服务和消息跟踪的情况下配置WCF 跟踪。这应该会为您提供来自 Web 服务的实际响应消息,并且还会为您提供更详细的错误消息。

回答by MichaelS

Similar issue here. Needed to update service reference after one of its dependencies was changed.

类似的问题在这里。在更改其依赖项之一后需要更新服务引用。