Presentation is loading. Please wait.

Presentation is loading. Please wait.

Qusay H. Mahmoud CIS*6650.01 1 CIS*6650.01 Service-Oriented Computing Qusay H. Mahmoud, Ph.D.

Similar presentations

Presentation on theme: "Qusay H. Mahmoud CIS*6650.01 1 CIS*6650.01 Service-Oriented Computing Qusay H. Mahmoud, Ph.D."— Presentation transcript:

1 Qusay H. Mahmoud CIS* CIS* Service-Oriented Computing Qusay H. Mahmoud, Ph.D.

2 Qusay H. Mahmoud CIS* Web Services… RPC the XML way (two ways) –1) XML-RPC ( –2) SOAP JAX-RPC, JAX-WS, … Document vs. RPC Style REST Web Services Architecture –

3 Qusay H. Mahmoud CIS* XML-RPC A specification and implementation that enable applications running in a heterogeneous environment to make procedure calls over the Internet Defined at UserLand Software in 1998 Uses HTTP as the transport protocol and XML for encoding Designed to be as simple as possible, allowing complex data structures to be transmitted, processed, and returned

4 Qusay H. Mahmoud CIS* XML-RPC Not a solution to every problem. Simple and effective mean for exchanging information (spec is less than 10 pages with examples and FAQ) "We wanted a clean, extensible format that's very simple. It should be possible for an HTML coder to be able to look at a file containing an XML-RPC procedure call, understand what it's doing, and be able to modify it and have it work on the first or second try... We also wanted it to be an easy to implement protocol that could quickly be adapted to run in other environments or on other operating systems." - Simplicity makes it limited

5 Qusay H. Mahmoud CIS* Sample XML-RPC request testcase.getMonthName(3)

6 Qusay H. Mahmoud CIS* Sample XML-RCP Response

7 Qusay H. Mahmoud CIS* XML-RPC to Java Mapping Explore mapping to other languages

8 Qusay H. Mahmoud CIS* SOAP A Lightweight XML-based protocol for exchanging information in a distributed environment More complex than XML-RPC (over 40 pages) Makes extensive use of XML namespaces and attribute specification tags in every element of a message Adds features that dont exist in XML-RPC: user- defined data types, specify recipient, message specific processing control, and others

9 Qusay H. Mahmoud CIS* Sample See Week2 slides

10 Qusay H. Mahmoud CIS* Comparison XML-RPC vs. SOAP

11 Qusay H. Mahmoud CIS* XML-RPC vs. SOAP SOAP supports request routing and pre-processing of requests via SOAP headers XML-RPC is lighter, taking up less bandwidth, and requiring less processing power SOAP is namespace-aware (in fact every element must be namespace-qualified) SOAP has a heavy-weight, robust data typing mechanism based on XML Schemas XML-RPC is easily sent and consumed, and is easily readable by humans SOAP messages have a considerable amount of packaging contained in the envelope, but this allows for flexibility in the messaging paradigm used (publish- subscribe, point-to-point, etc.)

12 Qusay H. Mahmoud CIS* JAX-RPC The push for Java API started in 2001 as JSR-101 ( V1.0 released in 2003 Java primitives are tied to XML schema types Supports more Java standard library objects (e.g. BigInteger) Architects of JAX-RPC has XML-RPC and SOAP in mind

13 Qusay H. Mahmoud CIS* JAX-WS Next version of the spec is known as JAX-WS (JSR- 224) Java API for XML-based Web Services Aims to reduce the complexity of web service development Java WSDP 1.6 (use GlassFish) Use JAX-RPC if: –Using simple requests –You control both the client/server –You dont need to publish WSDL –Want to keep client-side parsing simple –But remember…using standards is a good thing for interoperability (your apps need to interact with other third party apps)

14 Qusay H. Mahmoud CIS* Resources XML-RPC spec: SOAP: JAX-WS (JAX-RPC 2.0): https://jax- (JSR 224: https://jax- Apache XML-RPC: UserLand Frontier ( Many others…explore on your own

15 Qusay H. Mahmoud CIS* Document vs. RPC Style SOAP was originally designed to support RPC style Later (starting with SOAP 1.0), the spec expanded to support RPC and unstructured messages (document) RPC style: SOAP Body must conform to a structure that indicates the method name and a set of parameters Document style: SOAP Body can be structured in any way you like

16 Qusay H. Mahmoud CIS* RPC vs. Document Style Source: Anne Thomas Manes Blog, Message encoding: literal means Body contents conform to a specific XML Schema, SOAP encoding uses a set of rules based on XML Schema data types to encode the data RPC: includes an operation name or place holder and document style doesnt (significant architectural style) This document style example uses a state transfer style See more examples:

17 Qusay H. Mahmoud CIS* State Transfer Style Such as MOM (Message-Oriented Middleware), pipe-and-filter Architectural constraint: all components expose the same application interface –Through a single operation such as process Data –If a server exposes this operation, any client can submit data to it for processing –Since there is one operation, its use is implicit and doesnt need to be included in the message

18 Qusay H. Mahmoud CIS* REST REpresentational State Transfer –An architectural style –Think of it as a design pattern –Underlying concept for todays Web architecture –Every distinguishable entity is a resource –URLs identify resources –An approach for creating Web services

19 Qusay H. Mahmoud CIS* REST See the slides from

20 Qusay H. Mahmoud CIS* When to use REST or SOAP REST –The web services are stateless –A caching infrastructure can be leveraged –Service producer and consumer have mutual understanding of the context and content being passed along –Bandwidth is limited –Web service delivery into exiting web sites can be enabled easily with a RESTful style SOA –A formal contract must be established to describe the interface that the Web service offers –The architecture must address complex non-functional requirements –The architecture needs to handle asynchronous processing and invocation See details at: (read the section When to use REST)

21 Qusay H. Mahmoud CIS* Web Services Architecture Provides a common definition of a Web service, and defines its place within a larger Web services framework to guide the community Provides a conceptual model and a context for understanding Web services and the relationships between the components of this model Defines minimal characteristics common to all Web services, and characteristics that are needed by some but not all Web services Doesnt specify how Web services are implemented

22 Qusay H. Mahmoud CIS* Web Services Architecture Four models: Message-Oriented, Service-Oriented, Resource-Oriented, Policy) Core concepts and relationships of WS Source:

Download ppt "Qusay H. Mahmoud CIS*6650.01 1 CIS*6650.01 Service-Oriented Computing Qusay H. Mahmoud, Ph.D."

Similar presentations

Ads by Google