0% found this document useful (0 votes)
18 views12 pages

Lec 3 V 1

1. A web service is a software system identified by a URI that allows communication and data exchange over a network through defined XML interfaces. 2. Service oriented architectures utilize web services that publish their XML service descriptions so that requestors can locate, retrieve, and interact with the service. 3. Windows Communication Foundation (WCF) is a Microsoft technology that builds service-oriented applications based on message-based communication and allows services to expose functionality through contracts and endpoints that can be discovered.

Uploaded by

Osa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views12 pages

Lec 3 V 1

1. A web service is a software system identified by a URI that allows communication and data exchange over a network through defined XML interfaces. 2. Service oriented architectures utilize web services that publish their XML service descriptions so that requestors can locate, retrieve, and interact with the service. 3. Windows Communication Foundation (WCF) is a Microsoft technology that builds service-oriented applications based on message-based communication and allows services to expose functionality through contracts and endpoints that can be discovered.

Uploaded by

Osa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

Web Services and SOA

CS 237
Web Services - Definition
1.A Web service is a software system identified by a URI.
2. Web service public interfaces and its bindings are defined and
described using XML.
3.Web service definition can be discovered by other software
systems.
4.The software systems may then interact with the Web service in a
manner prescribed by its definition, using XML based messages
conveyed by internet protocols.
Service Oriented Architectures

Role Technologies capable of:


•Exchanging messages
service
•Describing Web services
requestor •Publishing and discovering Web
retrieves a service descriptions
service A service publishes its
Operation
description description

One-way, Component
conversational, many-
to-many
My slide explain the previous slide
The Service: It refers to the actual implementation of a web service. It is a software
designed to allow communication and data exchange over the network
The service description contains detailed information about the web service. It includes
the interface and implementation details, such as data types, operations (functions or
methods
Service description contains detailed information about the service
Publish: To make a web service accessible to potential requestors, it needs to publish its
service description. Publishing means making the service description available in a location
where requestors can find it
Find: The find operation is performed by a service requestor to locate and retrieve the
service description of a desired web service. The requestor can either directly access the
service description or query a registry or discovery mechanism that maintains a collection
of available web services
Interact: Once the service requestor has obtained the service description, it can initiate an
interaction with the web service.
Windows Communication Foundation(WCF)
1.WCF is one of the latest technologies that is used to build service-oriented
applications.
2.WCF builds service-oriented applications based on the concept of message-based
communication, in which an HTTP request is represented uniformly.
3. WCF makes it possible to have a unified API irrespective of diverse transport
mechanisms.
5. A WCF application consists of three components :
WCF service,
WCF service host
WCF service client.

6.Fundamental Concepts of WCF:


6.1.Message
• This is a communication unit comprises of several parts.
• Message instances are sent as well as received for all types of communication
between the client and the service.
6.2.Endpoint
•It defines the address where a message is to be sent or received.
•It also specifies the communication mechanism to describe how the messages will
be sent along with defining the set of messages.
•Endpoint comprises of the address specifies the exact location to receive the
messages and is specified as a Uniform Resource Identifier (URI).
6.3. Binding
•It defines the way an endpoint communicates. It comprises of some binding
•It states the protocols used for transport like TCP, HTTP.
•It states the format of message encoding.
•It states the protocols related to security as well as reliability.
6.4. Contracts
•It is a collection of operations that specifies what functionality the endpoint
exposes to the client.
•It generally consists of an interface name.
6.5. Hosting
•WCF service hosting which can be done through many available options like self-
hosting, IIS hosting, and WAS hosting.
6.6.Metadata
•This is a significant concept of WCF, as it facilitates easy interaction between a client
application and a WCF service.

6.7.WCF Client
•This can be hosted by any application, even the one that does service hosting.
6.8.Channel
•Channel is a medium through which a client communicates with a service.
6.9. Simple Object Access Protocol (SOAP)
•SOAP is not a transport protocol; instead it is an XML document comprising of a
header and body section.
Creating WCF Service
1.Launch Visual Studio.
2.Click on new project.
3.Select WCF option.
4. A WCF service is created that performs basic arithmetic operations like
addition, subtraction, multiplication, and division.
5.The main code is in two different files :
•interface
•class.
6.A WCF contains one or more interfaces and its implemented classes.
Example
[ServiceContract]
Public interface IService1
{
[OperationContract]
int sum(int num1, int num2);

[OperationContract]
int Subtract(int num1, int num2);

[OperationContract]
int Multiply(int num1, int num2);
[OperationContract]
int Divide(int num1, int num2);
}
Example
publicclassService1 :IService1
{ public int sum(int num1, int num2) {
return num1 + num2;
}
publicint Subtract(int num1, int num2) {
if (num1 > num2) {
return num1 - num2;
}
else {
return 0;
}
}
}
Example
publicint Multiply(int num1, int num2) {
return num1 * num2;
}

// This function returns integer value of two integer


number.
// If num2 is 0 then this function returns 1.
publicint Divide(int num1, int num2) {
if (num2 != 0) {
return (num1 / num2);
} else {
return 1;
}
}
Web Service Introspection Language

<inspection>
<abstract>Acme Industries Public Web Services</abstract>
<service>
<name>Store Finder Service</name>
<abstract>
A service to perform a geographical search of Acme stores.
</abstract>
<description
location="http://example.org/services/storefinder.wsdl"/>
</service>
<link location="http://example.org/services/ecommerce.wsil"/>
</inspection>

Service name
Link to an other WSIL page
Service location and description

You might also like