1 Lecture 21 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.

Slides:



Advertisements
Similar presentations
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Advertisements

Introduction to Web Services Protocols. Talk titledate2 Communication and standards Efficient (or indeed any) communication is dependent on a shared vocabulary.
Web Service Architecture
Siebel Web Services Siebel Web Services March, From
Overview of Web Services
CSE 6331 © Leonidas Fegaras Web Services1 Web Services (adapted from Erdogan Dogdu's presentation) Leonidas Fegaras.
31242/32549 Advanced Internet Programming Advanced Java Programming
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
SOAP : Simple Object Access Protocol
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
WEB SERVICES DAVIDE ZERBINO.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
Grid Computing, B. Wilkinson, 20043a.1 WEB SERVICES Introduction.
1 Java Server Programming zLecture 1 focuses on: yIntroduction to web services y Web Services using Axis y The bigger Picture: Introduction to J2EE y Java.
Processing of structured documents Spring 2003, Part 6 Helena Ahonen-Myka.
1 CS 483 Enterprise and Web Application Programming Week 7 Web Services.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
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 Services Architecture1 - Deepti Agarwal. Web Services Architecture2 The Definition.. A Web service is a software system identified by a URI, whose.
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
Web Services (SOAP, WSDL, and UDDI)
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Web Server Administration Web Services XML SOAP. Overview What are web services and what do they do? What is XML? What is SOAP? How are they all connected?
Web Services Description Language CS409 Application Services Even Semester 2007.
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Web Services Based on SOA: Concepts, Technology, Design by Thomas Erl MIS 181.9: Service Oriented Architecture 2 nd Semester,
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
Web Services. Abstract  Web Services is a technology applicable for computationally distributed problems, including access to large databases What other.
Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document.
WebService. Outline Overview of Web Services SOAP (messaging) WSDL (service description) UDDI (registry)
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
1 Web Services Web and Database Management System.
Enterprise Computing: Web Services
XML and Web Services (II/2546)
S imple O bject A ccess P rotocol Karthikeyan Chandrasekaran & Nandakumar Padmanabhan.
Kemal Baykal Rasim Ismayilov
Java Web Services CSCI 4300 Diagrams from the Sun Java Web Services Tutorial,
1 Service Oriented Architecture SOA. 2 Service Oriented Architecture (SOA) Definition  SOA is an architecture paradigm that is gaining recently a significant.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
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.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
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.
Sabri Kızanlık Ural Emekçi
WEB SERVICES.
Web Services-JAX-RPC JAX-RPC enables a Web Service endpoint to be developed using either a Java Servlet or Enterprise JavaBeans (EJB) component model.
Implementing a service-oriented architecture using SOAP
Web Server Administration
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Introduction to Web Services
WEB SERVICES DAVIDE ZERBINO.
Introduction to Web Services
Distributed System using Web Services
Distributed System using Web Services
Presentation transcript:

1 Lecture 21 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES

Topics Web Services. – XML – SOAP – WSDL – UDDI 2

Web Services Two competing architectures. –.NET (Microsoft). – Sun’s Java Web Services. We will discuss Sun’s Web Services. 3

Web Services Deployment is independent of the two technologies. – Interoperability between different languages. – Interoperability between different platforms. – Interoperability between transport protocols (messages can ride on top of existing protocols by adding an extra layer). 4

5 Java Web Services Java Web Services Developer Pack is used for web services and clients. Java Web Services Developer Pack includes the following: – Java API for XML Messaging (JAXM) – Java API for XML Processing (JAXP) – Java API for XML Registries (JAXR) – Java API for XML based RPC (JAX-RPC) – Java API for XML Web Services (JAX-WS) – SOAP with Attachments API for Java (SAAJ) – Java Server Pages Standard Tag Library (JSTL) – Java Server Faces – Java WSDP Registry Server – Web Applications Deployment Tool – Ant Build Tool – Apache Tomcat servlet container All of the above are part of EE5 and up.

6 Java Web Services Client Convert XML to Java Convert Java Type to XML Service Java Types Communicatiosn XML messages communications

Web Services Web Services is a technology geared for Internet Based Distributed Computing. – Requires adding to the Internet infrastructure another layer that is responsible for managing the resources needed for Web Services. – Designers can design a Web Service without a concern as to the type or the number of nodes that are going to use the service. – It is based on request/response messages. 7

Web Services Web Services use Internet protocols to publish their existence, discover each other and invoke each other. Publishing and discovery is done via: – UDDI Universal Description, Discovery and Integration specification. It is used to list the available services. – WSDL Web Services Description Language Describes the available services. 8

Web Services Other Protocols involved: – XML Custom made tags are used to structure the message. – SOAP (Simple Object Access protocol) Transfers the messages. 9

Web Services Web Services are based on the concept of Service-Oriented Architecture (SOA). SOAP is based on building components that can communicate with each other. – The components as in previous architectures that we studied (RMI, EJBs) must have well defined interfaces. 10

Web Services Any service architecture contains 3 roles: – A service provider Deployment of the service. Publishing (registering) the service. – A service requestor Finds a service description published in one or more registries. Invokes the desired service. – A service registry Advertizes web services descriptions published. It is the match maker between requestor and provider. 11

Web Services-XML XML mark up language’ specification identifies element as: – A pairing of start and end tags in a XML document. Elements have one of the following: – element-only content Nested elements – mixed content Nested elements and text mixed. – empty content. 12

Web Services -XML Elements can have attributes – A name value pair – Value is enclosed in quotation marks. For instance we can have an element called purchase order ( ) 13

Web Services -XML Alternatively instead of attributes we can define nested elements:

Web Services-XML - XML schemas – Document Type Definitions (DTD) document describes rules regarding the elements used. – Schemas are used to validate the contents of XML documents as they are parsed by the XML parser. – Schemas enable the following: Identification of the elements that are in a XML document. Identification of the order and relationship between elements in the XML document. 15

Web Services-XML Identification of the attributes of an element. Identification of the data type of the value of an attribute. Thus in summary, we have: – An XML document that defines the messages (data) in terms of XML elements. – A DTD document that describes the elements. – A need for a parser (can be written in Java) that checks the XML document against the DTD. If the XML document adheres to DTD it is called “well formed” otherwise errors are generated. 16

Web Services-XML The XML document then is made of 3 pieces: Called entities: – Elements – Attributes – Data 17

Web Services-SOAP SOAP is a specification that describes how data should be structured in order to be transported over the Internet as part of distributed services. SOAP is intended for B2B (Business to Business) or A2A (Application to Application) or EAI (Enterprise Application Integration). – It is not intended for Business to Customer. 18

Web Services -SOAP SOAP is usually embedded in HTTP packets as part of request / response – The riding of one protocol on top of another is called “tunneling”. SOAP handles data in terms of a textual form (RMI, CORBA and other distributed services protocols handle data in binary form). 19

Web Services-SOAP SOAP message – An instance of the XML document SOAP nodes – Peers of the distributed network that uses SOAP. SOAP receiver – A SOAP node that receives the SOAP message and processes it. SOAP intermediary – A SOAP node that acts as receiver and sender. 20

Web Services-SOAP 21 Client requests service intermediary intermediay Ultimate receiver SOAP Message Path Web Service resides in this node

Web Services-SOAP Intermediaries: – Can both accept and forward a message. – They can do some message processing. – Security domains are defined for the message. 22

Web Services-SOAP Message Exchange Patterns (MEP) – One way communication that specifies How many messages are interchanged in a given transaction. Originator of the message. Ultimate receiver of the message. – Two types of MEP Request-Response MEP, similar to POST in http. Response MEP, similar to GET in http. 23

Web Services-SOAP A SOAP message consists of: – Envelope (mandatory) It is the root element of the XML document – Header (Optional) Passes application specific information. It is used for transaction processing, authentication, login in. – Body (mandatory) Actual application data to be transported. – Fault Used to report errors back to sender 24

Web Services-SOAP 25

Web Services-SOAP The header uses special elements like: <wsa (web services addressing) i.e Message Exchange Pattern (MEP) type can be specified in the header. 26

Web Services-SOAP The body can be something like: …………. …….. ……. 27

Web Services-SOAP SOAP data model follows a hierarchical tree of nodes in the structure of the elements. Therefore we can have a Java program that creates the elements for the message, based on some tree structure. 28

Web Services-SOAP 29 Person Bill name Male gender Address 1000 ILChicago Person Eva Female address streetNumber state city name gender

Web Services-SOAP The java program can be: class Address { String city; String state; int streetNumber; public Address(int stNum, String c, String st) { this.streetNumber=stNum; this.city=c; this.state=st; } 30

Web Services-SOAP Class Person { String name; String gender; Address address; public Person(String n, String g, Address ad) { this.name=n; this.gender=g; this.Address=address; } 31

Web Services-SOAP How Java is used in Web Services: – We can create XML documents in XML – We can use a Java parser to parse the XML document’ s elements. The Java parser can use our DTD document a steh grammar file. – We can use a Java program based on JAXP API to read the XML elements and the data in the XML document. 32

Web Services-JAXP API JAXP (java API for XML Processing) has parsers for XML documents. – It provides a default parser. – Or it can be configured to use other parsers. – Can create a DTD programmatically. – Can create the XML document 33

JAX-WS API AX-WS stands for Java API for XML Web Services. JAX-WS is a technology for building web services using XML. It allows developers to write message- oriented as well as RPC-oriented web services. In JAX-WS, a web service operation invocation is represented by an XML-based protocol such as SOAP 34

JAX-WS API JAX-WS API hides the SOAP complexity from the application developer. On the server side, the developer specifies the web service operations by defining methods in an interface written in the Java programming language. The developer also codes one or more classes that implement those methods. 35

JAX-WS API A client creates a proxy (a local object representing the service) and then simply invokes methods on the proxy. The developer does not generate or parse SOAP messages. It is the JAX-WS runtime system that converts the API calls and responses to and from SOAP messages. 36

JAX-WS API 37 Just like in EE beans and JPA classes, annotations are used here also.

JAX-WS API package helloservice.endpoint; import public class Hello { private String message = new String("Hello, "); public void Hello() public String sayHello(String name) { return message + name + "."; } } 38

JAX-WS API In this example, the implementation class, Hello, is annotated as a web service endpoint using annotation. Hello declares a single method named sayHello, annotated with exposes the annotated method to web service clients. sayHello returns a greeting to the client, using the name passed to sayHello to compose the greeting. The implementation class also must define a default, public, no-argument constructor. 39

JAX-WS API When invoking the remote methods on the port, the client performs these steps: Uses the generated helloservice.endpoint.HelloService class which represents the service at the URI of the deployed service’s WSDL file. HelloService service = new HelloService(); Retrieves a proxy to the service, also known as a port, by invoking getHelloPort on the service. Hello port = service.getHelloPort();The port implements the SEI defined by the service. Invokes the port’s sayHello method, passing to the service a name. 40

JAX-WS API package simpleclient; import javax.xml.ws.WebServiceRef; import helloservice.endpoint.HelloService; import helloservice.endpoint.Hello; public class HelloClient { public static void main(String[] args) { try { HelloClient client = new HelloClient(); client.doTest(args); } catch(Exception e) { e.printStackTrace(); } } 41

JAX-WS API public void doTest(String[] args) { try { System.out.println("Retrieving the port from the following service: " + service); HelloService service = new HelloService(); Hello port = service.getHelloPort(); System.out.println("Invoking the sayHello operation on the port."); String name; if (args.length > 0) { name = args[0]; } else { name = "No Name"; } String response = port.sayHello(name); System.out.println(response); } catch(Exception e) { e.printStackTrace(); } } 42

Web Services-WSDL WSDL is used to describe the message syntax associated with the invocation and response of a web service. It is an XML document that conforms to WSDL schema definition. WSDL is to the web services what IDL is to RMI over IIOP and Corba. 43

Web Services-WSDL It describes 3 fundamental properties of a web service: – What a service does- that is the methods of the web service that can be invoked. – How a service is accessed- the data formats and protocols required to access the service. – Where a service is located- such as the URL for the service. It has special elements to allow description of the above i.e 44

Web Services-WSDL – Where message is modeled via the XML document. – It has a collection of elements. A special element in WSDL called binding tells how to format the message (the XML elements) – The binding element tells how to invoke the operation using SOAP over HTTP (or some other protocol). WSDL maps to Java via tools that automate the process. A tool like that is WSDL2Java provided by Apache Axis. (AXIS = Apache eXtensible Interaction System). 45

Web Services-UDDI UDDI facilitates service discovery – At design time (static discovery) – Or, at runtime (dynamic discovery). UDDI makes reference to a specific WSDL document for the service. UDDI uses its own elements to provide the description of the service. You can use Java to do the registration or the discovery of the service. A UDDI can be looked at as another web service. – It could be accomplished by using JAX (Java for XML ) API. 46

47 Service Provider Links to WSDL Documents Service Consumers UDDI Registry Publish Search SOAP messages

Study Guide Chapter 16 of EE5 Tutorial Or Chapters 11,12,13 of EE6 Tutorial 48