Web Services and Service Oriented Architecture
CS 4720 – Web & Mobile Systems
CS 4720 The tradi onal so ware model • Organiza ons build it all from scratch – “We can't trust anyone! Our compe tors will sabotage us!” – “We must own everything! Hardware and so ware!” • Companies that build so ware need components that do X or Y… – … so they buy COTS components – Service contracts, new releases, regression tes ng…
2 CS 4720 The tradi onal so ware model • How well does this work? • Some project data from the DOD: – 47% of so ware delivered could not be used • Usually didn't meet requirements – 29% of funded so ware never delivered • Usually canceled due to cost/schedule overruns – 19% of so ware useful a er extensive rework • Costs 36 mes more to fix problems a er release
3 CS 4720 A push to distribu on • “We're really good at ______, how can we get our ______out for people to use?” • The idea of distributed compu ng – “We're good at X, but not so good a Y…” – “What if we got someone to help us with Y… but in a way that we didn’t have to include any fancy libraries… – … and we could use them in web apps! And mobile devices! And even desktop apps!”
4 CS 4720 A Web Service • From W3C: “a so ware system designed to support interoperable machine-to-machine interac on over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its descrip on using SOAP-messages, typically conveyed using HTTP with an XML serializa on in conjunc on with other Web- related standards”
5 CS 4720 A Web Service? • Huh? • A bit more simply: A program, accessible via the Internet, that can do some func on (either for free or a fee) and can be dynamically discovered and used. • So… I use web apps all the me… are those web services?
6 CS 4720 Web Service as RPC • The earliest form of a true “web services” was an RPC – remote procedure call. • Exactly what it sounds like – there is an exposed func on/method that is accessed via the web where you pass the parameters and the method name and you get back a return value. • No ce how this is very different from the RESTful model (verbs vs. nouns)
7 CS 4720 Web Service as SOA • RPC was okay… but it turned out to be a bit more language specific than we'd like • What if we just a structured message (like an XML document) that described what we wanted, as opposed to knowing the exact func on call? • This is the basis of the Service-Oriented Architecture
8 CS 4720 Word By Word • What is a service? • "A service is a discoverable resource that executes a repeatable task, and is described by an externalized service specifica on.” • Business alignment – business requirements • Specifica ons – self-contained, well specified • Reusability – general enough to be reused • Agreements – based on func on, not pla orm • Hos ng and discoverability – available • Aggrega on – can be combined to make bigger services
9 CS 4720 Word By Word • What is an architecture? • "A formal descrip on of a system, or a detailed plan of the system at component level to guide its implementa on.” • “The structure of components, their interrela onships, and the principles and guidelines governing their design and evolu on over me."
10 CS 4720 Architecture • Architecture is: – A high-enough level of abstrac on that the system can be viewed as a whole and yet s ll provides enough informa on to make decisions. – Supports the func onality of the system. – All implementa on details are hidden. • Service orienta on is a way of integra ng a business as a set of linked services.
11 CS 4720 What are we actually trying to do?
Fork Receive PO
Update Customer Profile Get Items from Inventory
Branch Compute Subtotal
Compute Export Tax [ship within US] [ship outside US]
Compute Shipping Cost
Merge Compute International Shipping
Compute Total
Ship Order Join
12 CS 4720 OSI Model
13 CS 4720 OSI Model
14 CS 4720 The Stack
15 CS 4720 The Stack
ebXML UDDI Registries Discovery ebXML Contracts and CPA agreements OWL-S Service Process and workflow BPEL4WS BPML Model orchestrations WS-AtomicTransaction and WS- BTP QoS: Transactions BusinessXALcAtiNviGty WS-Reliable OWL-WS SSCeLrvice WS-Coordination QoS: Choreography Messaging ebXML Profile WSCI BPSS OWL-S Service WS-Security WSCL QoS: Conversations Grounding ebXML WS-Policy WSDL QoS: Service OWL PSL CPP descriptions and bindings ebXML RDF SOAP messaging Messaging XML, DTD, and XML Schema Encoding HTTP, FTP, SMTP, SIP, etc. Transport
16 CS 4720 The Stack
17 CS 4720 SOA – The Quick Version • Right now, you probably think of a so ware system as being a collec on of classes / objects • But users don't think of systems like that… they think of systems as sets of func onality that help them do something • So… why do we use objects? – Easier to model – Easier to program – Easier to explain to other programmers
18 CS 4720 Or is it actually easier? • Turn our idea of a system 90 degrees • Func onality objects (procedural abstrac on) is the key idea, not world objects (data abstrac on) • This is the key in SOA – An SOA system has the func onali es as the main players, not the objects themselves – But more so, these services are provided by many different players
19 CS 4720 But what language do we speak? • SOAP - Simple Object Access Protocol – A communica on protocol – A format for sending messages – Pla orm independent – XML based – Follows the rules that allow for transmission easily over HTTP, SMTP, etc. • Not really much more than an HTTP request that follows XML/SOAP standards
20 CS 4720 SOAP Model
21 CS 4720 SOAP Model
22 CS 4720 SOAP Request
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn