Step 1: Go to=>File=>New=>WebSite

Step 2: Select Asp.New Web service

Step 3: Write Method in your web
service class file.
My method name is: MyServiceMethod

Step 4: Then Run This Application
and watch this window in your browser. And also look at the method that has been
created by me. Here you can test whether your method works properly or not.

B.
Publish This service on
your local IIS server.
Step 1: Right click on your
application=>Publish Web site

Step 2: Checked =>Use Fixed Naming
and single page assemblies and browse target location.

Step 3: Select=>Local IIS=>Default
Website=>Create New Web Application by clicking on the small icon located at the above of this Screen shot.=>write name of your application.and click
on Open button.
=>You can access this web service
using=> http://localhost/mytestwebservice URL

Step 4=> After that click OK
button.

Step 5=> After that you can
access the the web service using this URL http://localhost/mytestwebservice/Service.asmx
C. How to consume Web service in Web
Application?
Consuming Web service :
=>Using WSDL generated Proxy
class.=>How to generate proxy class?
Step 1=>Open Command Prompt.From=>Start=>

Step 2=> Write this command on
Command Prompt.
Open=>Command prompt=>right click=>paste below written command
Open=>Command prompt=>right click=>paste below written command

Formate of command=>wsdl /l:CS /n:namespace /o:DriveName:\classname.cs
Service URL
wsdl /l:CS /n:myserviceclassnameSpace /o:d:\myserviceclassname.cs http://localhost/mytestwebservice/Service.asmx

After that Press enter.
Using this command generate the proxy class
file of the web service.you can use this class in in your web and window application.
Step 3=>Add myserviceclassname.cs file in your application and consume service in your application.

Step 4=>Call method of service class like this:

Step 5=> Out put is=>


Nirav ShahPosted Jan 7, 2015, 4:27 AM
thanks
Priti KumariPosted Jan 7, 2015, 4:27 AM
my id is [email protected]
Nirav ShahPosted Jan 7, 2015, 4:16 AM
id?
Nirav ShahPosted Jan 7, 2015, 4:08 AM
can i mail u the screenshot?
Nirav ShahPosted Jan 7, 2015, 4:08 AM
i downloaded and extracted the zip file to a particular folder.Opened it as a website .Build it.got no errors.but when running the web service i got the error
Nirav ShahPosted Jan 7, 2015, 3:41 AM
got an error The request failed with HTTP status 404: Not Found when running the website.Please advice
Jee KariraPosted Dec 22, 2013, 6:11 AM
10 on 10 thanks a lot....nice article
Krishna MurariPosted Dec 21, 2013, 10:13 PM
Great Work............Thank You
Priti KumariPosted Dec 21, 2013, 1:18 PM
Thanks
Prabhat kumarPosted Dec 17, 2013, 9:15 AM
very nice...