Skip to main content
 首页 » 编程设计

c#之如何在C#项目中添加vb webservice

2024年02月13日30tintown

大家好,我是 C# 网络服务的新手,

我需要澄清一下。在我的公司,我得到了一个 web 服务 url (http://servicename/psWs/psWs.asmx) 并且此服务中的方法是在 VB.net 中编写的。但我的问题是,我只知道 C# 并且我是 C# 的初学者,有没有办法创建 C# Web 服务或 WCF 并在 VSTS 中调用服务引用 url,其中 web 服务 url 方法是用 VB .net 编写的。你能帮忙解决任何问题吗?您的帮助更有值(value)。

最后我想要实现的是,

1.创建一个wcf C#应用程序或asp.net web应用程序

2.添加引用url (http://servicename/psWs/psWs.asmx) 方法是用VB.net写的

3.通过提供输入和验证输出来测试网络服务

如果我的问题无关紧要,请不要投反对票。

请您参考如下方法:

只需右键单击项目(您要在其中添加 Web 服务引用)并添加 Web 服务引用。语言在这里并不重要。来自 MSDN

  1. To add a Web reference to a project In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference. The Add Service Reference dialog box appears.
  2. In the Add Service Reference dialog box, click the Advanced button. The Service Reference Settings dialog box appears.
  3. In the Service Reference Settings dialog box, click Add Web Reference. The Add Web Reference dialog box appears.
  4. In the URL box, enter the URL of the Web service to use. If you do not know the URL, use the links in the browse pane to locate the Web service you want.
  5. In the Web services found at this URL box, select the Web service to use.