简体   繁体   English

C#Web服务

[英]C# web services

I am new to web services. 我是Web服务的新手。 I was just following a tutorial and created a web service. 我只是按照一个教程并创建了一个Web服务。 The next step was to create a proxy by entering wsdl followed by path to esdl contract. 下一步是通过输入wsdl,然后输入esdl contract的路径来创建代理。 It was supposed to create a service1.cs file however my system created service.cs file which was similar to except on the tutorial. 本来应该创建一个service1.cs文件,但是我的系统创建了与本教程类似的service.cs文件。

The next step is to create a console tester application. 下一步是创建控制台测试器应用程序。 I added the service.cs file to my console project but it cannot compile. 我将service.cs文件添加到我的控制台项目中,但无法编译。 I'm getting the following error: 我收到以下错误:

Error   1   
The type or namespace name 'Services' 
does not exist in the namespace 'System.Web' 
(are you missing an assembly reference?)    
C:\.....\tws\Service.cs 4   18  tws

Please help. 请帮忙。

Did you look in the project references? 您是否查看了项目参考?

System.Web.Services is NOT in System.Web but in a different separate assembly. System.Web.Services 不是System.Web ,但在不同的独立的组件。

See if there is a reference to : 查看是否有对的引用:

  System.Web.Services

if not add a reference to: 如果没有,请添加对以下内容的引用:

  System.Web.Services.dll

In your project System.Web.Services reference is missing to add this follow below 在您的项目中,缺少System.Web.Services参考以在下面添加以下内容

click on 点击

References> Add References>  Assemblies > Framework >System.Web.Services 

Either scroll the list to find this or type "System.Web.Services" in search box 滚动列表以查找此内容,或在搜索框中键入“ System.Web.Services”

select System.Web.Services and add it . 选择System.Web.Services并添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM