使用C#创建用于创建Web服务的C#客户端应用程序

时间:2017-05-17 09:57:57

标签: c# web-services

如果我使用工具测试,我已经创建了简单的Web服务。现在我想为此目的编写C#客户端应用程序。什么是最好的方法。

我正在尝试使用Web服务地址添加服务引用。我希望Web服务以某种方式向客户端提供WSDL信息。但这不会发生:

There was an error downloading 'http://localhost:11332/$metadata'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://localhost:11332/'.
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 787 bytes of the response were: '<!DOCTYPE html>
<html>

使用C#创建Web服务的客户端应用程序的最佳方法是什么?

UPD:

现在两者 - 客户端和服务都在同一个解决方案中。如果我通过选择“解决方案中的服务”来尝试在Web服务未运行时添加引用,则它什么也找不到。

0 个答案:

没有答案