WebServices Series Part - 1 [ Basic Creation ]
Reply
![]() |
|
|
From:
Nasha
|
Hey Group,
Today we will initiate our discussion on web services. Today we will primarily focus on creating our web service from tomorrow we will look into various details.
Web services are distributed asp.net applications that are designed to share business logic over the network. Simplest way to make a web service is to inherit your class from web service base class although it is possible to create a web service, which does not inherit from it. You can communicate with a web service using HTTP -GET, HTTP-POST or SOAP protocols.
Web services are about discovery, description and prototcols. UDDI and DISCO specifications are used to discover a web service. WSDL i.e. web service description language is used to describe web service. Clients that communicate with web services use WSDL to create their web service proxies.
Lets today just go ahead and build our web service.
1. Open a new ASP.NET web service project. 2. Name it as Trigonometry. 3. Rename Service1 as MyService.asmx 4. Add the following methods to our service.
public double Sine(double angel) { return System.Math.Sin(angel); }
public double CoSine(double angel) { return System.Math.Cos(angel); }
public double Tan(double angel) { return System.Math.Tan(angel); }
5. Compile and service and run it in the browser. You will notice none of the methods that we have written are visible. 6. Stop the application and go back and put the [WebMethod] attribute above each the methods. 7. Rebuild and execute the service again. 8. Execute all the methods and see that our web service is working.
To expose any method in a web service it is important to add [WebMethod] attribute to it. Tomorrow we will checkout the various PROPERTIES of the [WebMethod] attribute and also see how we can consume our web service by using different protocols.
-- Please post your queries and comments for my articles in the user group for the benefit of all. I hope this step from my end is helpful to all of us.
Regards,
Namratha (Nasha) <o:p></o:p> |
|
View other groups in this category.
![]() |
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.
|
|