Monday, September 9, 2013

How To Publish Web Service in Visual Studio

Hello folks
                Today Im going to show you how to make a web service in Visual Studio C#

1. So first make a new project of ASP.NET Web Service Application

2. Name the project and click on OK

3. Now you will be redirected to Service1.asmx.cs page

4. In this page there is 1 method already created name as HelloWorld()

5. You can either use this method OR you can create your own method here

6. Now right click on the project and click on Publish

7. Select Web Deploy as Publish Method

8. Now in the Service URL type the address where you want to publish the Web Service for local computer you can simple type localhost, to publish on remote computer you will require administrative rights.

9. In Site/Application type Default Web Site/WebService2

* where webservice2 is the name of your web service

10. Finally click on Publish

You have successfully published you web service

To be able to access this service from any application you will also need to publish this on IIS, click HERE to see how to do this


No comments:

Post a Comment