0

我正在使用 Visual Studio 2012 制作 Web Service 。我已经编写了 Web 服务的代码,但是当我尝试通过将其添加为服务参考(通过粘贴 Web 服务的运行 URL)在新网站中使用它时。它给出了以下错误:

"There was an error downloading 'http://localhost:3849/WebService3/WebService.asmx/_vti_bin/ListData.svc/$metadata'.
 Unable to connect to the remote server
 No connection could be made because the target machine actively refused it   127.0.0.1:3849
Metadata contains a reference that cannot be resolved:  'http://localhost:3849/WebService3/WebService.asmx'.
 There was no endpoint listening at http://localhost:3849/WebService3/WebService.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
 Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:3849
 If the service is defined in the current solution, try building the solution and adding the service reference again."

我应该怎么办?

4

1 回答 1

0
  1. 尝试在浏览器中浏览您的服务网址 http:// * :3849/WebService3/WebService.asmx/_vti_bin/ListData.svc 并查看元数据是否可用
  2. 确保操作和返回类型的所有参数都是泛型而不是特定于 .net
于 2013-10-18T06:57:28.197 回答