160 likes | 439 Views
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture. source: microsoft. definition(s):.
E N D
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft
definition(s): Service-oriented architecture (SOA) is a flexible set of design principles used during the phases of systems development and integration in computing. A system based on a SOA will package functionality as a suite of interoperableservices that can be used within multiple separate systems from several business domains. wikipedia A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. www.service-architecture.com
a service in a SOA context is: a software component that provides behaviour that can be used by any other component based only on its interface contract. A service has a network-addressable interface. A service stresses interoperability and a service may be dynamically discovered and used.
services are: • self-contained • on the client side, no additional software is required (i.e. access via exposed interface) • self-describing • neither the client nor the server knows or cares about anything besides the format and content of the request and response messages (loosely coupled application integration) • can be published, located, and invoked across the network (internet) • uses established lightweight standards such as HTTP and it leverages existing infrastructure • inherently open and standard-based • open-source, vendor agnostic, uses http, xml, json etc. • dynamic • can automate description and discovery • composable • can be chained together and aggregated to provide more complex behaviours • loosely coupled • independent, self-contained & encapsulated • provide programmatic access • - no gui, operates at the code level, implementation hidden (encapsulation) • wrap (abstract out) existing applications • - legacy, stand-alone applications can be wrapped with a service interface properties of services in a SOA context
the 4 essential components of a service in a SOA context are: service consumer- an application, component or other software module that requests a service; finds the service provider in a service registry, sends a service request and consumes the service service provider - is a network-accessible application or software component that provides a service to the consumer; the service provider publishes its contract in a service registry to make itself discoverable to service consumers. service contract - is a specification of the way in which a service consumer can access the functionality of a service - it informs the service consumer of the acceptable format of a service request; the service contract is stored in a service registry, allowing service consumers to discover and utilise the services offered by the provider. service registry - is a network-accessible registry that accepts and stores service contracts from providers and makes them discoverable to service consumers.
Simple Object Access Protocol (SOAP): SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation-specific semantics.
SOAP message format: • SOAP message consists of three parts: • - SOAP Envelope • - SOAP Header (optional) • - SOAP Body <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- optional --> <!-- header blocks go here... --> </soap:Header> <soap:Body> <!-- payload or fault element goes here... --> </soap:Body> </soap:Envelope>
example SOAP message (query stock price): POST /InStock HTTP/1.1Host: www.example.orgContent-Type: application/soap+xml; charset=utf-8Content-Length: nnn<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice></soap:Body></soap:Envelope>
example SOAP response (stock price): HTTP/1.1 200 OKContent-Type: application/soap+xml; charset=utf-8Content-Length: nnn<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse></soap:Body></soap:Envelope>
Web Service Description Language (WSDL) & Universal Discovery, Description & Integration (UDDI) • wsdl • is an xml vocabulary for describing a web service, where the service is located, the protocols, operations and methods the service supports and the parameters it expects and responds with • uddi • is a searchable directory that stores information about web services and the interfaces to those services described by wsdl
alphabet soup - service oriented, web oriented and resource oriented architectures: