Let's type some code in VB.NET for our sample Visual Studio project now.ĭouble click on button in desing mode and switch to code view Now our new service reference is listed under the " Service References" node in Solution Explorer window On Add Service Reference dialog screen, type the WSDL address for the web service () as follows then click "Go" buttonĭevelopers can also change the default namespace from ServiceReference1 to a more meaningful name like "webservicex" for example then click "OK" button On context menu follow options " Add > Service Reference." as seen in below screenshot.Īdd Service Reference in Visual Studio 2015 On Solution Explorer windows in Visual Studio IDE, right click on project name. NET developers can add the web service as service reference to their Visual Studio 2015 project. I arranged the form1.vb as seen in below screenshot.Ī textbox for input country code parameter for the service reference.Ī button to launch call to service reference.Īn other textbox to display service reference output for country name information.
Press OK to complete project creation from installed templates I used the VS2015 project and solution name as ConsumeServiceReference. Visual Studio 2015 Windows Forms Application project I chosed Windows Forms Application template for sample Visual Studio 2015 project to consume web service as service reference for this tutorial. Let's consume web service tested above using a Visual Studio project as service reference The inner text of the name node of web service response is showing the country name requested from the service. The response of the web service is as follows: Test GetCountryB圜ountr圜ode web service method
We can test the web service method from URL GetCountryB圜ountr圜ode using TR as input country code parameter.įinally press Invoke button to call web service using web browser for test purposes. Let's click on GetCountryB圜ountr圜ode method which returns the country name for given country code. Sample web service and methods provided to consume in Visual Studio Let's start by checking sample web service and web service methods provided with country.asmx
#WEB SERVICE VB NET 2010 HOW TO#
I'll also share sample codes and sample project showing how to consume web service as a Web Reference in an other Visual Studio tutorial.įor whom wondering the difference between web service vs service reference, please refer to explanation provided at by Vjeko In our VB.NET tutorial, we want to consume Country web service as a Service Reference instead of consuming as Web Service Assume that you are a VB.NET developer who wants to consume web service country.asmx which is provided free by WebserviceX.NET