gpt4 book ai didi

c# - 由于应用程序/dime (.Net) 的内容类型导致使用 Web 服务时出错

转载 作者:太空宇宙 更新时间:2023-11-03 14:10:10 24 4
gpt4 key购买 nike

我正在尝试使用生成以下错误消息的 ASP.Net 使用第 3 方 Web 服务:

Message=The content type application/dime of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

我能够连接到该服务并成功访问其中一项可用操作。但是,当尝试使用其他操作时,我收到上述错误消息。我正在使用.Net 4.0。第 3 方服务是用 .Net 编写的,虽然我不确定版本等。

我了解到应用程序/dime 类型不再受支持,但是有没有办法让我可以将此 Web 服务与 .Net 4.0 一起使用?

最佳答案

我在以下位置找到了一个包含一些提示的旧链接:http://www.ureader.com/msg/1438351.aspx

after adding a Web reference to the DIME-based Web service, you must modify the proxy class in the References.cs file so that it inherits from the Microsoft.Web.Services.WebServicesClientProtocol class in WSE. For example, the client Web service proxy generated for the ImageService Web service from the previous example needs to be modified as follows:

public class ImageService : Microsoft.Web.Services.WebServicesClientProtocol

这对您的工作有帮助吗?

关于c# - 由于应用程序/dime (.Net) 的内容类型导致使用 Web 服务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8084742/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com