8/13/2019 WebServices & SOA
1/54
Snehal Masnewww.TechProceed.com
Web Services and Service
OrientedArchitecture
http://www.techproceed.com/http://www.techproceed.com/8/13/2019 WebServices & SOA
2/54
Todays Web Web designed for application to human interactions
Served very well its purpose:
Information sharing: a distributed content library Enabled B2C e-commerce
Non-automated B2B interactions
How did it happen?
Built on very few standards Shallow interaction model: very few assumptions made
about computing platforms
Result was ubiquity
8/13/2019 WebServices & SOA
3/54
Module
A
Module
B
Module
C
Module
B
Module
A
CORBA
CORBACORBA
RMI
ProblemsInvolve a whole learning curveNot based on standardized rules and specifications
8/13/2019 WebServices & SOA
4/54
Whats next? The Web is everywhere. There is a lot more we can do!
E-marketplaces.
Open, automated B2B e-commerce.
Business process integration on the Web. Resource sharing, distributed computing.
Current approach is ad-hoc on top of existing standards.
e.g., application-to-application interactions with HTML
forms.
Goal:
enabling systematic application-to-applicationinteraction on the Web.
8/13/2019 WebServices & SOA
5/54
Standardized method of communication betweensoftware applications
Provide
ModuleB
ModuleA
C++ Java
Distributed components are interfacedvia non-object-specific protocols
Web Services
8/13/2019 WebServices & SOA
6/54
What is a web service?W3C Definition:
A Web service is a software application identified by a URI, whoseinterfaces and binding are capable of being defined, described and
discovered by XML artefacts and supports direct interactions withother software applications using XML based messages via internet-based protocols
Other definitions Web services is an effort to build a distributed computing platform
for the Web.
enabling systematic application-to-application interaction on theWeb.
8/13/2019 WebServices & SOA
7/54
Designing Web Services Goals
Enable universal interoperability.
Widespread adoption, ubiquity: fast!
Enable (Internet scale) dynamic binding. Efficiently support both open (Web) and more constrained
environments.
Requirements Based on standards. Pervasive support is critical.
Minimal amount of required infrastructure is assumed. Only a minimal set of standards must be implemented.
Very low level of application integration is expected. But may be increased in a flexible way.
Focuses on messages and documents, not on APIs.
8/13/2019 WebServices & SOA
8/54
Web Services Framework Describe
ExposeServices register in a repository providing
Business information (White pages)
Service information (Yellow pages) Binding information (Green pages) describing how to connect and
use the services
InvokeRemote application can invoke service
RespondWhen service is invoked, results are returned to therequester
Manage/Govern Provided structure and process control
8/13/2019 WebServices & SOA
9/54
A web service is a programmable component that provides a service and isaccessible over the Internet.
Component
Instance
Instance
Instance
Client
Client
Client
Network
Fundamentals of Web Services
8/13/2019 WebServices & SOA
10/54
Web services stack
Fundamentals of Web Services
8/13/2019 WebServices & SOA
11/54
Web services stack
Service & Information Layer
Service
Implementation
Web Service Interface
(WSDL)
Types
Message
Operation
Port Type
Binding
Port
Service
Fundamentals of Web Services
8/13/2019 WebServices & SOA
12/54
Using WSDL1. Describe the message interchange formats the service can support
2. WSDL may define where the service is available and whatcommunications protocol is used to talk to the service.
3. As extended IDL: WSDL allows tools to generate compatible clientand server stubs.
4. Allows industries to define standardized service interfaces.
5. Allows advertisement of service descriptions, enables dynamicdiscovery and binding of compatible services.
6. Provides a normalized description of heterogeneous applications.
8/13/2019 WebServices & SOA
13/54
WSDL Documentinterface
message______________
service
binding
endpoint/port
Abstract(service
interfacedefinition)
Concrete(service
implementation
Definition)
Logical grouping of operations
Data description using XML Schema
Actual data structures used to pass
data
Service Definition = Abstract + Concrete
Service Description = Service Definition + Supplementary Definitions
8/13/2019 WebServices & SOA
14/54
In Web services, a message is an XML document information item asdefined by the XML Information
The Information items generally maps to the various features in anXML document, such as elements, attributes, namespaces, andcomments .
All the technologies in Web Services are XML based Messaging Description Are all in XML
Registry
Why?
XML-eXtensible Markup Language
.
8/13/2019 WebServices & SOA
15/54
Web services stackPackaging Layer
Simple Object Access Protocol (SOAP) is a lightweight protocoldesigned for the exchange of information using XML
Defines a modular packaging model and the encodingmechanisms for encoding data within modules.
SOAP
Envelope
Encoding rules
RPC representation
Fundamentals of Web Services
8/13/2019 WebServices & SOA
16/54
Web services stack
Protocol Layer
Any of the standard Internet protocols may be used to invoke webservices over the network.
The initial definition focuses specifically on HTTP/1.1 and the
encrypted HTTPS
FTP and SMTP can also be used
Fundamentals of Web Services
8/13/2019 WebServices & SOA
17/54
A client invoking a Web service
Invoking a web service
8/13/2019 WebServices & SOA
18/54
The Universal Description, Discovery, and Integration protocol, orUDDI, specifies a protocol for querying and updating a commondirectory of Web service information.
UDDI directory approach can be used when Web service information isstored in well-known locations.
UDDI provides inquiry and publishing APIs Microsoft, IBM and SAP host the UDDI Business Registry.
Directory entry has three primary parts the service provider, Webservices offered, and bindings to the implementations.
Dynamically discovered Web services explicitly announce their arrivaland departure from the network.
Discovery Layer
8/13/2019 WebServices & SOA
19/54
UDDI Universal Description Discovery
and Integration
Marketplaces, searchengines, and businessapps query the registry
to discover services atother companies
3.
Business uses thisdata to facilitateeasier integrationwith each otherover the Web
4.
2.
Businessespopulatethe registry with
descriptions of theservices theysupport
BusinessDescriptions
SW companies, standardsbodies, and programmerspopulate the registry withdescriptions of differenttypes of services
1.
ServiceTypes
8/13/2019 WebServices & SOA
20/54
Web Services Pros and ConsPros
Global method for describingand finding Internetbasedbusiness services
Packaging and publishing ofapplications in a readilyunderstood format
New revenue streams throughsyndication of existing
application as Web Service
Cons
Emerging technology
Managing and Tracking changes
is a challenge Transactions not fully addressed
Multiple, evolving securitystandards
Processing overhead
8/13/2019 WebServices & SOA
21/54
Future Vision and Challenges Technology vendors plan to develop, market, and lend online Webservices to fulfill virtually any business function.
Companies will be able to simply search a public directory ofapplications and download those that fit their needs.
Right now we have only tools and standards which are still not matured,but its needless to say that its time to learn and practice some webservices development
Challenges
8/13/2019 WebServices & SOA
22/54
Example Google
A great search engine but what if I want my own GUI?
8/13/2019 WebServices & SOA
23/54
Google web service Google offers a web service that performs searches for
you
Why?
clients can build custom GUIs google.com can make money!
// ask google to search for us...
google = new GoogleSearchService();
result = google.doGoogleSearch("4a8/TvZQFHID0WIWnL1CMmMx0sNqhG8H",txtSearch.Text, 0, 10, false, "", false, "", "", "");
// display resulting URLs...foreach(ResultElement re in result.resultElements)
lstURLs.Items.Add(re.URL);
8/13/2019 WebServices & SOA
24/54
(1) Building a web service Start by creating a project of type ASP.NET Web
Service
8/13/2019 WebServices & SOA
25/54
A web service is One or more objects that respond to web-based
method calls
there is no GUI design to a web service
only raw classes with methods
public class Service1 : System.Web.Services.WebService
{
.
.
.}
8/13/2019 WebServices & SOA
26/54
Example Looks like C#, but keep in mind these are web-based methods
client could be calling from any platform
parameters passed using XML
public class Service1 : System.Web.Services.WebService
{[WebMethod]
public int Add(int x, int y)
{
return x + y;
}
[WebMethod]
public string[] Attendees()
{
}}
8/13/2019 WebServices & SOA
27/54
(2) Building a client Start by creating a client
WinForm, WebForm, console-based, anything youwant!
for fun, let's use VB
8/13/2019 WebServices & SOA
28/54
Reference the component
As usual, we need to reference component
this will activate IntelliSense
this will make sure we call it correctly
this will enable underlying XML +SOAP communication
How? project references, right-click, Add web reference
type URL for web service, e.g.
http://localhost/WebService/Service1.asmx
service
name
class
name
web
server
http://localhost/WebService/Service1.asmxhttp://localhost/WebService/Service1.asmxhttp://localhost/WebService/Service1.asmxhttp://localhost/WebService/Service1.asmx8/13/2019 WebServices & SOA
29/54
Program against component Treat web service like any other class!
use new to create instances
make method calls
pass parameters
Private Sub Button1_Click(...) Handles Button1.Click
Dim i, j, k As Integer
i = CInt(TextBox1.Text)
j = CInt(TextBox2.Text)
Dim obj As localhost.Service1
obj = New localhost.Service1()
k = obj.Add(i, j)
MessageBox.Show("Sum = " + k.ToString())
End Sub
8/13/2019 WebServices & SOA
30/54
Underlying execution
Web server
objclient app
proxy
obj.Add(i, j);
HTTP request: Service1.asmx
10
20
.asmx
web service
obj.Add(10, 20);
8/13/2019 WebServices & SOA
31/54
Allows a collection of services to communicate with each other and
unifies processes by collecting smaller service modules in an ad hocmanner.
Operational
Implementation Architectural
Business
Principles
Service Oriented Architecture
8/13/2019 WebServices & SOA
32/54
SOA Concept
SOA enables a standards-based marketplace of serviceconsumers and service providers across an enterprisecommunity or across the Web
SOA is a specification-based architecture to transition the
technical landscape to a standards-based, vendorindependent, and loosely-coupled information sharingenvironment Decoupling the service contract from the service
implementation
Promoting design and invocation by contract
8/13/2019 WebServices & SOA
33/54
Basic Component of SOA
Basic Components of SOA
8/13/2019 WebServices & SOA
34/54
De-mystifying SOASOA isA design philosophy
and Architecture
A means
A solution
Achieved through WebServices and relatedtechnologies
SOA is NOTA technology or a
methodology
Not an end
Not a product
Only Web Services
8/13/2019 WebServices & SOA
35/54
SOA Requirements Agility
Use of standards
Separation of concerns Reuse
Interoperability between different systems and programminglanguages.
Clear and unambiguous description language
Retrieval of the service Security
8/13/2019 WebServices & SOA
36/54
The ArchitectureSOA - an evolution in objectives
From To
Function oriented Process oriented
Build to last Build to changeProlonged development cycles Incrementally built and deployed
Application silos Orchestrated solutions
Tightly coupled Loosely coupled
Structuring applications usingcomponents or objects
Structure applications using services
Known implementation Implementation abstraction
8/13/2019 WebServices & SOA
37/54
The ArchitectureBuilding an SOA - a Closer look at services
Services in a Service-Oriented Architecture are always:Stateless:SOA services neither remember the last thing they
were asked to do, nor care what the next is.Discoverable:A service must be discoverable by potential consumersof the serviceSelf-describing:
The SOA service interface describes, exposes, andprovides an entry point to the service.Composable:SOA services are, by nature, composite.
8/13/2019 WebServices & SOA
38/54
The Architecture
Building an SOA - a Closer look at services
Single-instanceOnly one implementation of a given service should exist
in an SOA.Loosely coupledLoose coupling allows the concerns of application featuresto be separated into independent pieces.Governed by policy
Services are built by contract.Independent of location, language, and protocolServices are designed to be location-transparent andprotocol/platform-independent
8/13/2019 WebServices & SOA
39/54
The Architecture
Building an SOA - a Closer look at services
As Coarse-grained as possibleServices are typically coarse-grained business functions.
Granularity is a statement of functional richness for a service the more coarse-grained a service is, the richer the functionoffered by the service.Potentially Asynchronous
Asynchronous communication is not required of an SOA service,
but it increases system scalability through asynchronous behaviorand queuing techniques.
8/13/2019 WebServices & SOA
40/54
SOA Infrastructure Standards
ManagementGovernanceMediation
Service DiscoveryMessagingSecurity
UDDI
ebXML
WS-Discovery
WS-RMWS-RM policy
WS-Policy
WS-Addressing
WS-Notification
WSSSAML
XACML
XML-Signature
XML-Encryption
WS-Trust
WS-Policy
WS-SecurityPolicy
XKMS
XSL
BPEL
WS-Policy
XQuery
XPath
WSDM
WS-Management
8/13/2019 WebServices & SOA
41/54
Steps to Implement SOA
1. Create/Expose Services
2. Register Services
3. Secure Services4. Manage (monitor) Services
5. Mediate and Virtualize Services
6. Govern the SOA
Source:SOA Software, Inc., 2008.
8/13/2019 WebServices & SOA
42/54
1. Create & Expose Services Three primary choices
Rebuild existing applications using SOA paradigm
Expose existing application logic as a set of services
A combination of rebuild and expose
Enterprises typically use a combination of rebuild & expose
Granularityis a key criterion for Web Service
Source:SOA Software, Inc., 2008.
2. Register Services Application architects & developers need to know that a service exists
Use a registry
8/13/2019 WebServices & SOA
43/54
3.Secure Services
May have inadvertently created gaping security holes
May have exposed sensitive information
principles of security
Source:SOA Software, Inc., 2008.
4. Manage Services Look for potential disaster
Need to be able to monitor for
Basic Availability
Performance Throughput
SLA agreement
8/13/2019 WebServices & SOA
44/54
5. Mediate & Virtualize Services As SOA matures may need to:
Introduce new versions Increase capacity by running multiple instances Provision applications to use specific instances of services
Solution is Virtualization
XML transformation can be used to allow consumers to use an old version of servicethat no longer exists. Consumers can provide different policy requirements for different classes of users Transport bridging can be provided
E.g. HTTP and JMS Meditation between different standards implementation or versions of standards Mediation between different messaging styles
RSS, SOAP, REST, Plain old XML (POX) Content-or-context-based routing to deliver advanced load-balancing and high-
availability capabilities
Source:SOA Software, Inc., 2008.
8/13/2019 WebServices & SOA
45/54
6. Govern the SOA Use a governance framework Design Time Issues
Run Time Issues
Tools needed for active participants
Service Developer needs tools to:
Publish, categorize, define meta-data, virtualize
Choose policy, participate in capacity planning & access workflow
Service Consumer needs tools to:
Facilitate service discovery, selection & access workflow
Operations Staff need to:
Monitor service performance
Troubleshoot problems, monitor dependencies
Version services, virtualization & proxy management
Source:SOA Software, Inc., 2008.
8/13/2019 WebServices & SOA
46/54
Govern the SOA Contd Security Staff needs tools to:
Manage policy, report policy, check compliance, audit security
Enterprise Architect needs tools to:
Monitor application, manage relationships
Define & validate design policy
Assign services to proxy
Virtualize services
Enterprise IT Management
Manage reuse metrics
Gather service reuse statistics Gather SOA statistics
Source:SOA Software, Inc., 2008.
8/13/2019 WebServices & SOA
47/54
Enterprise Service Bus (ESB) ESB is the backbone of SOA that acts as a message
broker providing a message queuing system usingindustry standard specifications for messaging such as
SOAP, or JMS (Java Message Service). Expert Sally Hudson, an IDC analyst, describes the
Enterprise Service Bus as an open standards-basedmessaging means designed to provide interoperability
between larger-grained applications and othercomponents via simple standard adapters andinterfaces.
8/13/2019 WebServices & SOA
48/54
ESB Architecture
Reliable Asynchronous Secure Messaging
ERP .NET Web Services
SOAP/
HTTP
SOAP/
HTTP
SOAP/
HTTP JMS
JCATransformation
(XSLT)
Connection Layer
Connection Layer
Communication Layer
C/C++ Legacy
ApplicationJ2EE
8/13/2019 WebServices & SOA
49/54
According to the SOAA Web service is:
An interface that describes a collection of network accessibleoperations
Described using a service description languagePublished by making this service description available tousers
Found by sending queries to a registry matching servicedescriptions
Bound-Invoked by using the information contained in theservice description
Composed with other services to create new services (serviceorchestration)
8/13/2019 WebServices & SOA
50/54
How it all works together
8/13/2019 WebServices & SOA
51/54
SOA vs CORBA & DCOM
8/13/2019 WebServices & SOA
52/54
Benefits Provides location independence: Services need not be
associated with a particular system on a particularnetwork
Protocol-independent communication frameworkrenders code reusability
Offers better adaptability and faster response rate to
changing business requirementsAllows easier application development, run-time
deployment and better service management
8/13/2019 WebServices & SOA
53/54
Benefits (cont.) Loosely coupled system architecture allows easy
integration by composition of applications,processes, or more complex services from otherless complex services
Provides authentication and authorization ofService consumers, and all security functionalityvia Services interfaces rather than tightly-coupledmechanisms
Allows service consumers (ex. Web Services) tofind and connect to available Services dynamically
8/13/2019 WebServices & SOA
54/54
Thank YouQuestions???
Top Related