Survey about Web Services CMP167 – Programação com Objetos Distribuídos Prof. Cláudio Geyer Gisele Pinheiro Souza 07/2009.

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

Introduction to Web Services
Overview of Web Services
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
Information Management NTU Web Services. Information Management NTU What Are Web Services? Semantically encapsulate discrete functionality Loosely coupled,
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Presentation 7 part 1: Web Services Introduced. Ingeniørhøjskolen i Århus Slide 2 Outline Definition Overview of Web Services Examples Next Time: SOAP.
Presentation 7: Part 1: Web Services Introduced. Outline Definition Overview of Web Services Examples Next Time: SOAP & WSDL.
1 An Introduction to Web Services. 2 Outline What is a Web service Background Standards –XML & XML Namespaces, XML Schema,WSDL, SOAP Tools & APIs –DOM/SAX,JAX-RPC/JAX-M.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
CS 571. Web services Web service: "a software system designed to support interoperable machine-to-machine interaction over a network“ – W3C In short,
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Lecture 10: Web Services. Outline Overview of Web Services Create a Web Service with Sun J2EE (JAX-RPC)
CSE 636 Data Integration Web Services.
2006 IEEE International Conference on Web Services ICWS 2006 Overview.
RSS RSS is a method that uses XML to distribute web content on one web site, to many other web sites. RSS allows fast browsing for news and updates.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
Processing of structured documents Spring 2003, Part 6 Helena Ahonen-Myka.
1 CS 483 Enterprise and Web Application Programming Week 7 Web Services.
Web Services Mohamed Fahmy Dr. Sherif Aly Hussein.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Web Service YU-RONG CHEN June 5 th Outline Web Service – SOAP – WSDL – UDDI – Implementation RESTful Web Service – REST – Example – Implementation.
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
Presentation 7: Part 1: Web Services Introduced. Outline Definition Overview of Web Services Examples Next Time: SOAP & WSDL.
Prepared By : Monika Darji Web Services using REST & JAX-WS.
Web Services 1 Oren Shamir Gal Moshitch. Web Services 2 Contents The World and the Problem Historical solutions Brief history of Web Services WS: The.
Web Services An introduction for eWiSACWIS May 2008.
Message Driven Beans & Web Services INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
Google’s Web Service January 4, 2004 Shuying Wang.
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Web Services interoperability and standards. Infrastructure Challenge ● Applied bioinformatics need various computer resources ● The amount and size of.
Web Services. Abstract  Web Services is a technology applicable for computationally distributed problems, including access to large databases What other.
Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services JSP and Web Services 18 th March 2005.
WebService. Outline Overview of Web Services SOAP (messaging) WSDL (service description) UDDI (registry)
1 Seminar on Service Oriented Architecture Principles of REST.
Web Services (SOAP) part 1 Eriq Muhammad Adams J |
XML and Web Services (II/2546)
What is a Web Service? Distributed Computing Model Distributed Computing Model  Loosely Coupled, Course Grained  Standard HTTP Transport  Sync/Async.
Kemal Baykal Rasim Ismayilov
Advanced Web Technologies Lecture #4 By: Faraz Ahmed.
RESTful Web Services What is RESTful?
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Advanced Java Session 10 New York University School of Continuing and Professional Studies.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Java Web Services Orca Knowledge Center – Web Service key concepts.
Introduction to Web Services
An Introduction to Web Services
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Unit – 5 JAVA Web Services
GF and RS, Dept. of CS, Mangalore University
Representational State Transfer
Overview of Web Services
WEB API.
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
Distributed System using Web Services
Distributed System using Web Services
Techniques to Invoke Web Services from SAS
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Survey about Web Services CMP167 – Programação com Objetos Distribuídos Prof. Cláudio Geyer Gisele Pinheiro Souza 07/2009

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

Motivation The web services are one of the most popular approaches for making system integration There are many specifications and implementations for developing a web service It is hard to find a tutorial that talks about all possibilities of web services development The goal of this presentation is to put together the different aproaches for web service development

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

What is a web service? According to W3C: “A Web service is a software system designed to support interoperable machine-to-machine interaction 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 description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.” But, can only frameworks, which use SOAP and WSDL, be considered web services framework?

Web Services Frameworks There are many frameworks that uses SOAP and WSDL as the W3C definition:  Example: Axis, Metro Sun There are many others frameworks called as “web services” frameworks, but they don’t use SOAP and WSDL:  Example: Hessian, Restlet

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

Web Services with SOAP - I DiscoveryUDDI Description SOAP Transport XML Messaging HTTP WSDL LayersExample Protocol Stack

Web Services with SOAP - II Service Discovery – is responsible for maintaning a centralized register of the services, and provides a easy way for publish/find services. Examples  UDDI (Universal Description, Discovery, and Integration)  ebXML (electronic business XML ) - Developed by UN/CEFACT and OASIS

Web Services with SOAP - III Service Description – is responsible for describing a public interface of the service Example: WSDL(Web Service Description Language) ?... … a container for data type definitions an abstract description of an action supported a concrete protocol and data format specification for a port type. a collection of endpoints

Web Services with SOAP - IV Protocol Stack:  XML Messaging – is responsible for enconding the message in XML format that can be understood by both end Example: SOAP (Simple Object Access Protocol)

Web Services with SOAP - V Protocol Stack:  Service Transport – is responsible for transporting message between the applications Example: HTTP

SOAP Web Services Frameworks and APIs - I JAX-WS (Java API for XML Web Services) is a technology for building web services and clients that communicate using XML  Implementations: Metro Sun, JBossWS

SOAP Web Services Frameworks and APIs - II JAX-RPC (Java API for XML-based RPC) is for Web services interoperability across heterogeneous platforms and languages  Implementations: JAX-RPC Project(Part of Glassfish), Axis

SOAP Web Services Frameworks and APIs - III JAXR (Java API for XML Registries ) - provides a uniform and standard Java API for accessing different kinds of XML Registries  Used for access UDDI and ebXML registry

SOAP Web Services Frameworks and APIs - IV SAAJ (SOAP with Attachments API for Java) –I s an API you can use to write direct SOAP messaging applications instead of using the JAX-RPC APIs  Implementations: Sun metro

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

Axis Available in Java and C++ versions HTTP servlet and JMS transport

Axis Example - I Client public class TestClient { public static void main(String [] args) { try { String endpoint = " Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint) ); call.setOperationName(new QName(" “echoString")); String ret = (String) call.invoke( new Object[] { "Hello!" } ); System.out.println("Sent 'Hello!', got '" + ret + "'"); } catch (Exception e) { System.err.println(e.toString()); }

Axis Example - II Request Hello!

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

REST REST (REpresentation State Transfer) describes an architectural style introduced in 2000 in a Ph.D dissertation by Roy Fielding A Restful architecture has the characteristics:  Resource Identification  Uniform Interface  Self-Describing Messages  Hypermedia Driving Application State  Stateless Interactions

Resource Identification Each “thing” (resource) has a name. Each element is defined by a URI.  Example: (the costumer with id 12347) (the orders done in 10/2007) The application state is also a resource  Example: 23

Uniform Interface There are standard methods for manipulating the resources MethodFunctionCharacteristics GetRetrieves a resourceSafe, Idempotent, cacheable PostInserts, updates or extends a resource PutCreates, updates or replaces a resource Idempotent DeleteDeletes a resource Idempotent HeadRetrieves a representation and resource metadata Safe, Idempotent  Safe – The is not side effect when perform the action  Idempotent – The request can be done multiple times  Cacheable – the response can be cached

Self-Describing Messages The URI defines the resource The method defines the operation The format can be defined between the peers No additional information is needed for identifying the operation

Hypermedia Driving Application State/ Stateless Interactions Hypermedia Driving Application State  The Restful applications navigates instead of call other resources;  The URI defines the resources and state Stateless Interactions  The client request should contain all information needed for performing the operation;  No context in the server side is needed

Restful Web Services Frameworks and APIs - I Java-WS - Java API for XML Web Services ( JSR224) and JAXB – Java Architecture for XML Binding  Sun Reference Project: Metro Sun  The server can be called programmatically (java API) or by using browsers (XMLHttpRequest)  Uses WADL(Web Application Description Language)designed to provide a machine process-able protocol description format for use with HTTP-based Web applications

Restful Web Services Frameworks and APIs - II JAX-RS - The JavaTM API for RESTful Web Services (JSR 311 ) - focuses on using annotations to make plain old Java objects (POJOs) and resources available through HTTP  Sun Reference Project: Jersey  Other Vendors: CXF (Apache), RESTEasy(JBoss) and Restlet

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

Restful Web Services Frameworks and APIs - III Restlet  Available editions: Java SE/EE, Google Web Kit, Google AppEngine and Google Androide  Some available connectors Multiple server HTTP connectors (example Jetty) Multiple client HTTP connectors (example Apache HTTP Client) Client SMTP, SMTPS, POP v3,POPS v3 and JDBC  Some available representations JAX, JibX, DOM, SAX base, JSON  Some Configuration Option Complete configuration possible in Java via the Restlet API Configuration possible via Restlet XML and WADL files

Restlet – Example I Standalone server example public class FirstStepsApplication extends Application public synchronized Restlet createRoot() { Router router = new Router(getContext()); // Defines only one route router.attachDefault(HelloWorldResource.class); router.attach("/books/{autor}", BooksResource.class); return router; }

Restlet – Example II Resource I public class HelloWorldResource extends Resource { public HelloWorldResource(Context context, Request request, Response response) { super(context, request, response); getVariants().add(new Variant(MediaType.TEXT_PLAIN)); public Representation represent(Variant variant) throws ResourceException { Representation representation = new StringRepresentation( "hello, world", MediaType.TEXT_PLAIN); return representation; }

Restlet – Example III Resource II public class BooksResource extends Resource { Hashtable map = new Hashtable(); public BooksResource() { super(); map.put("Gisele", “test”); public void handleGet() { String autor = (String) getRequest().getAttributes().get("autor"); Representation result = new StringRepresentation((String)map.get(autor)); getResponse().setEntity(result); }

Restlet – Example IV Run Server public class FirstStepsMain { public static void main(String[] args) { try { Component component = new Component(); component.getServers().add(Protocol.HTTP, 8182); component.getDefaultHost().attach(new FirstStepsApplication()); component.start(); } catch (Exception e) { e.printStackTrace(); }

Restlet – Example V Client public class RestletClient { public static void main(String [] args) throws IOException { String uri = " ; Client client = new Client(Protocol.HTTP); client.get(uri).getEntity().write(System.out); String uri2 = " ; Client client2= new Client(Protocol.HTTP); client2.get(uri2).getEntity().write(System.out); }

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

Hessian Web Service Protocol Was created as a lightweight binary alternative to the XML-based web services protocols Is a small protocol, J2ME devices can use it to connect to Resin servers Some Hessian Implementation  Java, Python, C++, C#, Ruby,PHP Support Synchronous and Asynchronous messages Uses URL for identifying the services, can support object name without extra header  Example: bean?ejbid=slytherin (Entity Bean Identifier) bean?ejbid=slytherin

Hessian Structure - I Has a specific format for sending the information Supports the following types:  Primitives: binary, boolean, date, double, int, long, null, string  Recursive type: list, map, object  Special structure: Ref for circular reference

Hessian Structure - II Example:  JSON 37 ["hello, world", 29] {"color" : "green", "year" : 2003}  Hessian 0xb7 # int values 0-47 are encoded by 0x90 to 0xbf V x0c hello, world # string with length 0-31 start with 0x00 to 0x1f Xad # integer 0xb7 O t x00 x06 qa.Car # Class definition x92 # two fields x05 color # "color" field x04 year # "year" field o x90 # object instance, 0x90 is def #0 x05 green # color : green xcf xd3 # year : 2003

Hessian Example - I Client public interface Basic { public String hello(); } public class BasicClient { public static void main(String []args) throws Exception { String url = " HessianProxyFactory factory = new HessianProxyFactory(); Basic basic = (Basic) factory.create(Basic.class, url); System.out.println("Hello: " + basic.hello()); }

Hessian Example - II Server public class BasicService implements Basic { private String _greeting = "Hello, world"; public void setGreeting(String greeting) { _greeting = greeting; } public String hello(){ return _greeting; }

Hessian Example - III Configuration for standard web.xml hello com.caucho.hessian.server.HessianServlet home-class example.BasicService home-api example.Basic /hello hello

Index Motivation What is a Web Service? SOAP  Characteristics  Example: Axis REST  Characteristics  Example: Restlet Hessian  Characteristics  Example Conclusion Bibliography

What is a Web Service? (Revisited) - I Back to the web service definition: “A Web service is a software system designed to support interoperable machine-to-machine interaction 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 description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.” The web services frameworks enumerated on this presentation follows this definition?  Sentence 1(pink) -  SOAP based  Restful  Hessian  Sentence 2(green) -  SOAP based  Restful  Hessian  Sentence 3(blue) -  SOAP based  Restful  Hessian  Sentence 4(purple) -  SOAP based  Restful  Hessian

What is a Web Service? (Revisited) - II If the 3 approaches presented are web services, so we could say that the web services is: “A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. typically conveyed using HTTP with an XML serialization in conjunction with other Web- related standards.” This is a very vague description There is a web service specification, but it is not really defined.

Conclusion I SOAP based web services  Strengths It is very used by almost projects The same message can be transported by many middlewares  Weakness There is a problem to link the memory structure to the XML structure The XML schema is not powerful RESTFul web services  Strengths Lightweight structure The developer can use a browser to test

Conclusion II RESTFul web services  Weakness It is not all firewalls that accepts all methods HTTP (normally GET and POST are accepted ) Problems to send a large amount of input data by using get Hessian  Strengths It has implementation in many languages It is possible to create graphs on the messages  Weakness The messages are not so clear It is not very used in projects

Comparison among the 3 approaches SOAPRESTHessian Synchronous callyes Asynchronous call yesnoyes Payload FormatXML(SOAP)Any (defined by the peers) Hessian binary protocol HTTP as transport layer yes Languages support many

Bibliography I 1.html?page=4 1.html?page= html?page=1 2.html?page= Introduction.html#Introduction Introduction.html#Introduction

Bibliography II featuddi/ featuddi/

Survey about Web Services CMP167 – Programação com Objetos Distribuídos Prof. Cláudio Geyer Gisele Pinheiro Souza 07/2009