Thursday, October 18, 2012

ASP.NET : Creating a Web Service.

This is a demo project for creating a Web Service by using Visual Studio 2010 create with two Tier concept.
1st Tier is WebSite
2st Tier is WebService site
I have create step by step to inform you.
If you not understand you can download source code from a bottom of this demo.

Step 1 : Add a WebService to your WebSite.

create web service

Step 2 : Crea Hello World Method (if not exist).

create web service

Step 3 : Add a new WebSite for call web service.

create web service

Step 4 : Add Web Reference to MainSite by click on your mainsite > Add Service Reference

create web service

Step 5 : Click Advance > Add Web Reference > WebService on this solution
It will find WebService on solution to show you and click WebService Name it to "WSTest"

create web service
Result : you will found generated file in solution.
create web service

Step 6 : Test calling a WebService.

create web service
The Result
I create method name GetString and return "Hello World + GetString" to display in page by using Response.Write.
create web service

Download create web service demo here

If you understnd how to create WebService already, Please visit How to using WebService via JavaScript/jQuery. for more information thank ^^

Enjoy ZomDev

No comments:

Post a Comment