Web Service Architecture

Click to rate this post!
[Total: 0 Average: 0]

 Web Service Architecture  

To view Web Service Architecture we have two ways as shown below

  • The first is to look at the individual parts of each web benefit on-screen character.
  • The second is to inspect the rising web benefit convention stack.

Service  Provider

This is the supplier of the web benefit. The Service Provider  co-op executes the administration and makes it accessible on the Internet or internet. We will compose and distribute a basic web benefit utilizing .NET by the help with Service Provider.

Service Requester

This is any buyer of the web benefit. The requester uses a current web benefit by opening a system association and sending a XML ask. We will likewise compose two web benefit requesters one online buyer (ASP.NET application) and another Windows application-based customer.

Given beneath is our first web benefit case which functions as a specialist co-op and uncovered two techniques as the web administrations to be utilized by applications. This is a standard layout for a web benefit. .NET web administrations utilize the asmx augmentation. Note that a strategy uncovered as a web benefit has the Web Method trait. Spare this document as FirstService.asmx in the IIS virtual registry (as clarified in designing IIS; for instance, c:\MyWebSerces).

JAVA Tutorial Video


<%@ WebService dialect = “C#” class = “FirstService” %>

utilizing System;

utilizing System.Web.Services;

utilizing System.Xml.Serialization;


open class FirstService : WebService



open int Add(int an, int b)


restore a + b;



open String SayHello()


return “Hi World”;



To test a web benefit, it must be distributed. A web administration can be distributed either on an the Internet. We will distribute this web benefit on IIS running on a neighborhood machine. Give us a chance to begin with arranging the IIS.

Open Start → Settings → Control Panel → Administrative devices → Internet Services Manager.

Grow and right-tap on the default site; select new → Virtual Directory. The Virtual Directory Creation Wizard opens. Snap Next.

The “Virtual Directory Alias” screen opens. Sort the virtual registry name. For instance, My Web Services furthermore, click next.

The “Site Content Directory” screen opens. Enter the registry way name for the virtual catalog. For instance, c:\MyWebServices Click Next.

The “Get to Permission” screen opens. Change the settings according to your necessities. Give us a chance to keep the default settings for this activity.

Snap Finish to finish the design.

To test whether the IIS has been designed legitimately, duplicate a HTML record (For instance, x.html) in the virtual registry (C:\MyWebServices) made above. Presently, open Internet Explorer and sort http://localhost/MyWebServices/x.html. It should open the x.html record.

Note: If it doesn’t work, have a go at supplanting the local host with the IP address of your machine. On the off chance that regardless it doesn’t work, check whether IIS is running; you may need to reconfigure the IIS and the Virtual Directory.

To test this web benefit, duplicate FirstService.asmx in the IIS virtual registry made above (C:\MyWebServices). Open the web benefit in Internet Explorer (http://localhost/MyWebServices/FirstService.asmx). It should open your web benefit page. The page ought to have connects to two strategies uncovered as web benefits by our application. Congrats! You have composed your first web benefit!

Testing the Web Service

As we have quite recently observed, written work web administrations is simple in the .NET Framework. Composing web benefit customers is likewise simple in the .NET system; in any case, it is more included. As said before, we will compose two sorts of administration buyers, one online and another Windows application-based customer. Give us a chance to compose our first web benefit purchaser.

Online Service Consumer

Compose an online shopper as given beneath. Call it WebApp.aspx. Note that it is an ASP.NET application. Spare this in the virtual catalog of the web benefit (c:\MyWebServices\WebApp.aspx).

This application has two content fields that are utilized to get numbers from the client to be included. It has one catch, Execute, that when clicked gets the Add and Say Hello web administrations.


<%@ Page Language=”C#” %>

<script runat=”server”>

void runSrvice_Click(Object sender, EventArgs e){

FirstService mySvc = new FirstService();

Label1.Text = mySvc.SayHello();

Label2.Text = mySvc.Add(Int32.Parse(txtNum1.Text),





<head> </head>


<form runat=”server”>


<em>First Number to Add </em>:

<asp:TextBox id=”txtNum1″ runat=”server” Width=”43px”>4</asp:TextBox>



<em>Second Number To Add </em>:

<asp:TextBox id=”txtNum2″ runat=”server” Width=”44px”>5</asp:TextBox>



<strong><u>Web Service Result -- </u></strong>



<em>Hello world Service</em> :

<asp:Label id=”Label1″ runat=”server” Font-Underline=”True”>Label




<em>Add Service</em> :

and <asp:Label id=”Label2″ runat=”server” Font-Underline=”True”>Label



<p align=”left”>

<asp:Buttonid=”runService”onclick=”runSrvice_Click”runat=”server” Text=”Execute”></asp:Button>





After the customer is made, we have to make an intermediary for the web administration to be devoured. This work is done naturally by Visual Studio .NET for us while referencing a web benefit that has been included. Here are the means to be taken after.

Make an intermediary for the Web Service to be devoured. The intermediary is made utilizing the WSDL utility provided with the .NET SDK. This utility concentrates data from the Web Service and makes an intermediary. The intermediary is substantial just for a specific Web Service. In the event that you have to devour other Web Services, you have to make an intermediary for this administration also. Visual Studio .NET makes an intermediary consequently for you when the Web Service reference is included. Make an intermediary for the Web Service utilizing the WSDL utility provided with the .NET SDK. It will make FirstSevice.cs record in the present registry. We have to assemble it to make FirstService.dll (intermediary) for the Web Service.

c:> WSDL http://localhost/MyWebServices/FirstService.asmx?WSDL

c:> csc/t:library FirstService.cs

Put the gathered intermediary in the receptacle catalog of the virtual index of the Web Service (c:\MyWebServices\bin). Web Information Services IIS searches for the intermediary in this registry.

Make the administration customer, similarly we as of now did. Note that a protest of the Web Service intermediary is instantiated in the customer. This intermediary deals with interfacing with the administration. Sort the URL of the shopper in IE to test it (for instance, http://localhost/MyWebServices/WebApp.aspx).

 Windows Application-Based Web Service Consumer

Composing a Windows application-based web benefit purchaser is the same as composing whatever other Windows application. You just need to make the intermediary (which we have officially done) and reference this intermediary when assembling the application. Following is our Windows application that uses the web benefit. This application makes a web benefit question (obviously, intermediary) and calls the Say Hello, and Add techniques on it.


utilizing System;

utilizing System.IO;

namespace SvcConsumer {

class SvcEater {

open static void Main(String[] args) {

FirstService mySvc = new FirstService();

Console.WriteLine(“Calling Hello World Service: ” + mySvc.SayHello());

Console.WriteLine(“Calling Add(2, 3) Service: ” + mySvc.Add(2, 3).ToString());




Presently, the inquiry emerges: How would you be able to make certain that this application is really calling the web benefit

It is easy to test. Stop your Web server with the goal that the Web Service can’t be reached. Presently, run the WinApp application. It will fire a run-time special case. Presently, begin the web server once more. It should work.

to our newsletter

Drop Us A Query

Trending Courses
  • oracle 12c rac | OnlineITGuru
    Oracle RAC Training
  • Oracle is the large vendor in providing the various storge services to the people across the globe. This vendor provides a different amount of storage services to the people across the globe.

  • salesforce lightning training | OnlineITGuru
    Salesforce Lightning Training
  • Developing an application is not a simple and easy task. There are various parameters that the web developer need to take care while developing an application. One of those parameters that the developer needs to take care of is the code reusability.

  • Selenium with python
    Selenium with Python Training
  • As we know, that Selenium with Python Web Browser Selenium Automation is Gaining Popularity Day by Day. So many Frameworks and Tools Have arisen to get Services to Developers.

  • machine learning with python
    Machine Learning with Python Training
  • Over last few years, Big Data and analysis have come up, with Exponential and modified Direction of Business. That operate Python, emerged with a fast and strong Contender for going with Predictive Analysis.

  • Data science with R
    Data Science With R Training
  • Understanding and using Linear, non-linear regression Models and Classifying techniques for stats analysis. Hypothesis testing sample methods, to get business decisions.

  • data science with python
    Data Science with Python Training
  • Everyone starts Somewhere, first you learn basics of Every Scripting concept. Here you need complete Introduction to Data Science python libraries Concepts.

100% Secure Payments. All major credit & debit cards accepted.

Call Now Button