Steps to create a webservice, DOT NET Programming

What are the steps to create a webservice?

This webservice will add 2 numbers and send  to the calling client.All the below steps shown are according to VS2005 beta editor :-

1) At First create a website by clicking on File -- New WebSite.

2) By the "Visual Studio Installed Templates" click on the "Asp.NET Web Service". Now Name the figure as "Maths Web Service".

2033_webservice project.png

Figure:-Create WebService Project

3) By default the .NET editor has made a default webservice method known  as "HelloWord" that returns a string datatype. Let's rename "Service.vb" to "Maths.vb" & "Service.asmx" to "Maths.asmx". Let's replace the "HelloWorld" with the following code shown below:-

_

Public Function AddTwoNumbers(ByVal Number1 As Integer, ByVal

Number2 As Integer) As Integer

Return Number1 + Number2

End Function

707_webservice project1.png

Figure: - Rename all your default "Service" to "Maths"

4) After the webservice is completed  click on add Webreference. Generally for components we do a "Add Reference" and for Webservices we do "Add Web Reference".

1295_webservice project2.png

Figure:-Click on Add Web Reference

5) You will be shown with a list of webservices that are known to the solutions. As we are looking for our "Maths" webservice that exist in the similar solution, we click "Webservices in this solution".

370_webservice project3.png

Figure: - List of webservices for browsing

6) Now your editor has located the "Maths" webservice.Now Select the webservice

505_webservice project4.png

Figure: - Solution shows the availability of Maths Webservice.

7)After you have clicked on "Maths" webservice you will see a search progress bar as shown. This process will start up the webservice, reference it and create a proxy for the client, so by using it client can absorb the webservice.

562_webservice project5.png

Figure: - Starting the webservice and creating the proxy for your solution

8)Finally you are able to get your webservice which is ready for use. Now Click on Add Reference and you will see a "Localhost" reference in your .NET solution.

782_webservice project6.png

Figure: - Starting the webservice and creating the proxy for your solution.

9) We need to make a client who will absorb the "Maths Webservice". Now Add "WebserviceClient.aspx" and create a UI as shown . In the button click put it in the following code. "LocalHost.The ClsMaths" is the proxy object by which you can make calls to the webservice.

Sub cmdCalculate_Click(ByVal sender As Object, ByVal e As

System.EventArgs)

Dim pobjMaths As New localhost.ClsMaths lblResultDisplay.Text =

Convert.ToString(pobjMaths.AddTwoNumbers(Convert.ToInt16(txtNumber1.Text), Convert.ToInt16(txtNumber2.Text)))

End Sub

681_webservice project7.png

Posted Date: 9/22/2012 2:23:45 AM | Location : United States







Related Discussions:- Steps to create a webservice, Assignment Help, Ask Question on Steps to create a webservice, Get Answer, Expert's Help, Steps to create a webservice Discussions

Write discussion on Steps to create a webservice
Your posts are moderated
Related Questions
Connect a Software Application to a Database Backend Acquire the knowledge and develop the skills needed to prototype an end user application using a rapid application dev

What is Data Independence? Data independence means that "the application is independent of the storage structure and access method of data". In other words, the ability to cha

Assembly: 1) Assembly is a unit of deployment such as EXE or a DLL. 2) An assembly consists one or more files (dlls, exe's, html files etc.),& represents a group of resources,

I need C# Programmer Project Description: To help in the production of a C# module to provide a web service. We are based in Littlehampton, West Sussex. Skills required ar

Develop .Net project Project Description: We want to make .net you have to be good knowledge on the subsequent Microsoft Active Directory, Lync 2010 - 2013 databases

What is the difference among a toolstrip drop-down button and a toolstrip split button? The difference among a toolstrip drop-down button and a toolstrip split button is that a

Problem: (a) Explain the difference between these two lines of ASP codes: (b) The VBScript language includes some built-in functions which are often used in ASP co

What are indexes? The Indexes in the SQL Server are similar to the indexes in books. They help SQL Server to retrieve the data quickly.These are classified into clustered and n

How do we access view state value of the page in the next page? The View state is page specific; it contains information about controls embedded at the particular page. ASP.NET

Project Description: We are seeking someone who can write a program in C# or C++. The idea is to prepare the program using a Cross Platform environment like Mono or Qt which