Cocoon: A Framework for Web Services

Slides:



Advertisements
Similar presentations
웹 서비스 개요.
Advertisements

18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Introduction to Web Services Protocols. Talk titledate2 Communication and standards Efficient (or indeed any) communication is dependent on a shared vocabulary.
Siebel Web Services Siebel Web Services March, From
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
General introduction to Web services and an implementation example
SOAP.
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.
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
UNIT-V The MVC architecture and Struts Framework.
SOA, BPM, BPEL, jBPM.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
1 Understanding Cocoon2 Pankaj Kumar May 24, 2001 Web Services Organization HPMD, SSO, HP.
Web Services Mohamed Fahmy Dr. Sherif Aly Hussein.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
SDPL 2002Notes 7: Apache Cocoon1 7 XML Web Site Architecture Example: Apache Cocoon, a Web publishing architecture based on XML technology
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Web Services Description Language (WSDL) Jason Glenn CDA 5937 Process Coordination in Service and Computational Grids September 30, 2002.
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
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.
Enterprise Computing: Web Services
XML and Web Services (II/2546)
Kemal Baykal Rasim Ismayilov
1 G52IWS: Web Services Chris Greenhalgh. 2 Contents The World Wide Web Web Services example scenario Motivations Basic Operational Model Supporting standards.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Cocoon An XML Web Publishing Framework From the Apache Project Roland Schweitzer.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
Apache Cocoon – XML Publishing Framework 데이터베이스 연구실 박사 1 학기 이 세영.
Added Value to XForms by Web Services Supporting XML Protocols Elina Vartiainen Timo-Pekka Viljamaa T Research Seminar on Digital Media Autumn.
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
Labs: Create, deploy and test a simple web service
Java Web Services Orca Knowledge Center – Web Service key concepts.
Introduction to Web Services
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
A Web Services Journey on the .NET Bus
WEB SERVICES.
Introduction to Advanced Java Programming
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Outline SOAP and Web Services in relation to Distributed Objects
Distributed web based systems
Outline SOAP and Web Services in relation to Distributed Objects
Knowledge Byte In this section, you will learn about:
Overview of Web Services
Design and Maintenance of Web Applications in J2EE
Introduction to Web Services and SOA
Inventory of Distributed Computing Concepts and Web services
Distributed System Using Java 2 Enterprise Edition (J2EE)
The future of distributed systems architecture
A Match Made In (Ethereal) Heaven
Inventory of Distributed Computing Concepts
Introduction to Web Services
Distributed System using Web Services
WEB SERVICES From Chapter 19, Distributed Systems
Introduction to Web Services and SOA
Distributed System using Web Services
Presentation transcript:

Cocoon: A Framework for Web Services 9/18/2018 Cocoon: A Framework for Web Services Using Cocoon to consume and produce Web Services Pankaj Kumar pankaj_kumar@hp.com Web Services Architect, HP Middleware Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Presentation Goals Understand Apache Cocoon, Web Services and how Cocoon can be used to build Web Applications that consume Web Services; and Web Services that process huge XML documents Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Speakers’ Qualifications 9/18/2018 Speakers’ Qualifications More than 12 years of System Programming experience Development manager in HP E-speak development Development manager of HP XML Application Frameworks ( Cocoon connection … ) Currently Web Services Architect at HP Middleware ( Web Services connection … ) Contributor to Cocoon project JAX-RPC and JSR109 Expert Group Member Personal web-site: http://www.pankaj-k.net Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Presentation Topics What is Cocoon? Exploring Cocoon 9/18/2018 Presentation Topics What is Cocoon? Exploring Cocoon What are Web Services? Cocoon and Web Services A Simple Cocoon Web Application Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 What is Cocoon? Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Apache Cocoon XML based publishing Framework 9/18/2018 Apache Cocoon XML based publishing Framework An Apache Software Foundation opensource project Written in Java, runs as a servlet ( not strictly true ! ) Project Home Page: http://xml.apache.org/cocoon Started as a simple servlet based XSL styling engine for http://java.apache.org site Current version is in the second generation of evolution Designed for scalability ( uses SAX processing ) -- can process huge documents using small amount of memory History: Cocoon Project was started by Stefano Mazzocchi in 1998. Reference: An article by Stefano on Cocoon http://www.xml.com/pub/a/2002/02/13/cocoon2.html Running Cocoon: Cocoon can also be run as a standalone program taking commandline arguments; or Main Cocoon class can be instantiated from another Java program. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Apache Cocoon ( Contd. ) Promotes separation of Content, Logic, Presentation and Management in web-site design. Four different working contexts (the rectangles): Management - The people that decide what the site should contain, how it should behave and how it should appear Content - The people responsible for writing, owning and managing the site content. This context may contain several sub-contexts - one for each language used to express page content. Logic - The people responsible for integration with dynamic content generation technologies and database systems. Style - The people responsible for information presentation, look & feel, site graphics and its maintenance. Five contracts (the lines) management - content management - logic management - style content - logic content - style Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Exploring Cocoon Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Getting Started Download Cocoon Distribution from http://xml.apache.org/cocoon I used Cocoon 2.0.1 for this presentation Unzip the distribution file cocoon-2.0.1-bin.zip. Drop cocoon.war to webapps directory of your Servlet Container I used Tomcat 4.0.1 as the Servlet Container Start the Servlet Container Point your browser to http://localhost:8080/cocoon Preconditions -- You need a Web Browser, Java SDK and a Servlet container on your machine and sufficient disk space. I used: -- Windows 2000 machine -- IE 5.0 -- JDK 1.3.1 from Sun Microsystems -- Apache Tomcat 4.0.1 Directory Structure -- unzipping the distribution file creates directory cocoon-2.0.1 with subdirectories docs, legal and WAR file cocoon.war. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Cocoon Welcome Page This page is also the entry point for all bundled samples and examples. A good way to find out various features is to play around with this page. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon Servlet Dirs. & Files Directory for auto mounting sub-sitemaps 9/18/2018 Cocoon Servlet Dirs. & Files Directory for auto mounting sub-sitemaps Cocoon Configuration file A sub-sitemap directory Sitemaps are hierarchical. A sub-sitemap can be dynamically added, without modifying the parent sitemap, by moving to directory for auto mounting. A number of logs are maintained in the WEB-INF\log directory. Very useful for debugging. log-level is specified in file web.xml of Cocoon servlet. Main sitemap file Directory for log files Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon Sitemap Why Sitemap ? What does it contain? 9/18/2018 Cocoon Sitemap Why Sitemap ? need to de-couple exposed URI space from actual location of resources need easily changeable specification of processing steps What does it contain? Component declarations generators, transformers, serializers, ... Resource declarations named collection of pipeline components Pipeline declarations sequential arrangement of components for processing Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon Sitemap ( Contd. ) 9/18/2018 Cocoon Sitemap ( Contd. ) A sitemap is an XML file Sitemaps are hierarchical -- A sitemap can point, explicitly or implicitly, to sub-sitemaps A sitemap is translated into a java program and is compiled to bytecode Changes to sitemaps can be loaded dynamically and asynchronously. Cocoon community has debated extensively on philosophical aspects of Sitemap but nothing better has come out ( yet ! ). Dynamic loading of sitemap ==> no need to stop and start the Cocoon servlet for changes in the sitemap to become effective. Asynchronous loading of sitemap ==> The sitemap is read, validated, compiled and loaded in the background, without impacting the response time of the system during this process. Sitemap Critique: Sitemap mixes control ( logic ) and management. Single point of failure. Hard to maintain. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

A sample pipeline <map:pipeline> 9/18/2018 A sample pipeline <map:pipeline> <map:match pattern="hello.html"> <map:generate src="docs/samples/hello-page.xml"/> <map:transform src="stylesheets/page/simple-page2html.xsl"/> <map:serialize type="html"/> </map:match> <map:match pattern="images/**.png"> <map:read src="resources/images/{1}.png" mime-type="image/png"/> <map:handle-errors> <map:transform src="context://stylesheets/system/error2html.xsl"/> <map:serialize status-code="500"/> </map:handle-errors> </map:pipeline> Processing of XML within a pipeline can be considered as flow of water in a river. XML SAX events pass through the pipeline components one after another. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Request Processing By Cocoon 9/18/2018 Request Processing By Cocoon Request is dispatched to matching pipeline Basic pipeline operation The generator generates XML content Zero or more transformers transform the content The serializer writes it to the output stream Different Kinds of generators File, Directory, XSP, JSP, Stream, … Different Kinds of transformers XSLT, I18N, Log, … Different Kind of Serializers HTML, XML, Text, PDF, SVG, ... Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Dynamic Content from XSP 9/18/2018 Dynamic Content from XSP <!-- A simple XSP Page --> <xsp:page language="java” xmlns:xsp=“http://apache.org/xsp” > <page> <title>A Simple XSP Page</title> <content> <para>dynamically generated list:</para> <ul> <xsp:logic> for (int i=0; i < 3; i++) { <li> Item <xsp:expr>i</xsp:expr> </li> } </xsp:logic> </ul> </content> </page> </xsp:page> Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

What Are Web Services? 9/18/2018 Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Most commonly used definition: 9/18/2018 Defining Web Services Most commonly used definition: Web Services are described in WSDL exchange SOAP messages use HTTP as transport optionally, registered in UDDI registry Interaction can happen using RPC style or Document Exchange style, synchronously or asynchronously Knowledge of Implementation language or deployment platform is not required for interaction. Web Services promise Interoperability. Interoperability => Ability of a program running within one environment ( programming language, h/w platform, OS, …) to communicate, by invoking method calls or exchanging messages, to programs running within another environment. Portability => Ability of a program to run within different environments. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

SOAP 1.1 XML based protocol for exchange of information 9/18/2018 SOAP 1.1 SOAP 1.1 Message Structure SOAP Envelope [Header Element] Header Entries Body Element [Fault XML based protocol for exchange of information Encoding rules for datatype instances Convention for representing RPC invocations Designed for loosely-coupled distributed computing Used with XML Schema Transport independent SOAP with Attachments allow arbitrary data to be packaged. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

WSDL 1.1 A WSDL document describes 9/18/2018 WSDL 1.1 WSDL 1.1 Document Structure A WSDL document describes What the service can do Where it resides How to invoke it WSDL are like IDL but lot more flexible and extensible Defines binding for SOAP1.1, HTTP GET/POST and MIME WSDL descriptions can be made available from an UDDI registry WSDL Document [Types] {Messages} {PortTypes} {Bindings} {Services} Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

What is a Web Services Platform ? 9/18/2018 What is a Web Services Platform ? Environment, tools, libraries and other resources for: Development of web services top down -- start with user code and generate WSDL bottom up -- start with WSDL and generate interfaces middle out -- a combination discovery of service interfaces Deployment of web services publishing of services pre and post processing of SOAP requests, responses processing requests for WSDL descriptions Consumption of Web Services discovery of Web Service invocation of/interaction with Web Services Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Java Platforms and Standards 9/18/2018 Java Platforms and Standards Java Platforms for Web Services HP WSP, HP WSR, HP WST Apache SOAP 2.2, Apache Axis, UDDI4J, Cocoon JWSDK ( Reference Implementation from Sun ) … Emerging Java Standards for Web Services JAXM ( Java XML Messaging ) JAX-RPC ( Java Web Service Client Prog. model) JSR 109 ( Java Web Service Prog. Model, deployment, ...) JAXR ( Java API to access Web Service Registries ) J2EE 1.4 ( J2EE platform for Web Services ) Java standards promise portability HP WSP => HP Web Services Platform HP WSR => HP Web Services Registry HP WST => HP Web Services Transactions JWSDK => Java Web Services Development Kit Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Observations on Java Platforms and Standards 9/18/2018 Observations on Java Platforms and Standards Handle synchronous RPC style Web Services quite well Not so good at supporting Web Services with document exchange style, especially with asynchronous interface Have difficulty dealing with large data Many approaches to build and consume Web Services ( but must adhere to wire protocols ) Standards in many areas are still emerging routing, reliable messaging security transactioning ... Large Data -- Large XML fragments within SOAP Body Huge attachments ( as per SOAP w/ Attachments specification ) Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon and Web Services 9/18/2018 Cocoon and Web Services Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon as a Presentation Framework for Web-Services 9/18/2018 Cocoon as a Presentation Framework for Web-Services Client Tier Web Tier Web Services WS Registry Enterprise Apps Servlet Container Cocoon Cocoon is a natural fit in the web-tier, between a browser and backend web-services. In this configuration, a program running within Cocoon environment invokes web-services, reformats the obtained data ( for presentation ) and serves it to the client. HP has developed the abstraction of XScript within Cocoon processing model that makes it possible to do pure xml computation within an XSP. HP has developed the SOAP and UDDI logicsheets ( tag libraries for the XSP environment ) that make it extremely easy to invoke web-services from Cocoon environment. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Cocoon as a Processing Framework for Web Services 9/18/2018 Cocoon as a Processing Framework for Web Services Client Tier Web Tier Web Services WS Registry Enterprise Apps Servlet Container Cocoon P1 P2 It turns out that SAX based processing model of Cocoon is also very good to build complex web services that Need to manage state across multiple interactions, Support asynchronous messaging Support reliable delivery of messages …. Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

A Simple Cocoon Web Application 9/18/2018 A Simple Cocoon Web Application Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

9/18/2018 Problem Statement Use Google Web Services API from http://www.google.com/apis to create a simple web application that accepts a search string from user and displays the list of result entries. Acknowledgement: This example is based on the XSP contributed by Ugo Cei in Cocoon-dev mailing list. HP WSP => HP Web Services Platform HP WSR => HP Web Services Registry HP WST => HP Web Services Transactions JWSDK => Java Web Services Development Kit Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Application Components 9/18/2018 Application Components sitemap.xmap -- Sitemap for this application index.html -- HTML file to accept search string google.xsp -- XSP file that makes the SOAP call to Google Web Service using SOAP logicsheet. search-results.xsl -- XSL stylesheet to transform SOAP response from Google Web Service to HTML page Downloadable from http://www.pankaj-k.net/sdwest2002/google.zip HP WSP => HP Web Services Platform HP WSR => HP Web Services Registry HP WST => HP Web Services Transactions JWSDK => Java Web Services Development Kit Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Application Architecture 9/18/2018 Application Architecture Cocoon Servlet Google WS Browser http://<host>/cocoon/mount/google/ Maps request to index.html index.html …/search?q=... SOAP request SOAP response executes google.xsp Search results in HTML Applies search-results.xsl Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Demo Architecture Browser Cocoon Servlet 9/18/2018 Demo Architecture Cocoon Servlet Browser http://<host>/cocoon/mount/google/welcome-local Maps request to index-local.html index.html …/search-local?q=... Reads google.results Search results in HTML Applies search-results.xsl Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here

Web Application Demo [Walk through the Design, Sources and the Demo] 9/18/2018 Web Application Demo [Walk through the Design, Sources and the Demo] HP WSP => HP Web Services Platform HP WSR => HP Web Services Registry HP WST => HP Web Services Transactions JWSDK => Java Web Services Development Kit Tuesday, September 18, 2018Tuesday, September 18, 2018Tuesday, September 18, 2018 Choose View, Header and Footer to enter text here