简体   繁体   English

如何在C#项目中添加VB Web服务

[英]How to add vb webservice in C# project

Hi i am new to C# web services, 嗨,我是C#网络服务的新手,

I need a clarification. 我需要澄清。 In my company , i was given a webservice url (http://servicename/psWs/psWs.asmx) and the methods in this service are writtn in VB.net . 在我的公司中,为我提供了一个Web服务URL (http://servicename/psWs/psWs.asmx) ,该服务中的方法在VB.net中已被写入。 But my problem is , i know only C# and i am a beginner in C# , is there a way to create C# Web Service or WCF and call the service reference url in VSTS where the web service url methods is written in VB .net. 但是我的问题是,我只知道C#,而且我是C#的初学者,有没有一种方法可以创建C#Web服务或WCF并在VSTS中调用服务引用URL,其中Web服务url方法是用VB .net编写的。 Can u please help to any solution . 你能帮忙解决任何问题吗? Your help is more valuable. 您的帮助更有价值。

Finally what i am trying to achieve is , 最后,我想达到的目标是

1.create a wcf C# application or asp.net web application 1.创建一个WCF C#应用程序或asp.net Web应用程序

2.Add the reference url (http://servicename/psWs/psWs.asmx) where the methods is written in VB.net 2.添加参考网址(http://servicename/psWs/psWs.asmx) ,其中方法是用VB.net编写的

3.Test the web service by giving input and validating the output 3.通过提供输入并验证输出来测试Web服务

Please dont downvote if my question is irrelavant. 如果我的问题不相关,请不要投票。

Just right click the project (in which you want to add web service reference) and add the web service reference. 只需右键单击该项目(您要在其中添加Web服务引用)并添加Web服务引用。 Language doesn't matters here. 语言在这里无关紧要。 From MSDN 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. 向项目添加Web引用在解决方案资源管理器中,右键单击要将服务添加到的项目的名称,然后单击“添加服务引用”。 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. 在“服务引用设置”对话框中,单击“添加Web引用”。 The Add Web Reference dialog box appears. 出现“添加Web参考”对话框。
  4. In the URL box, enter the URL of the Web service to use. 在“ URL”框中,输入要使用的Web服务的URL。 If you do not know the URL, use the links in the browse pane to locate the Web service you want. 如果您不知道URL,请使用浏览窗格中的链接找到所需的Web服务。
  5. In the Web services found at this URL box, select the Web service to use. 在“在此URL上找到的Web服务”框中,选择要使用的Web服务。

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

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