Cics Web 2.0 With Atom Feeds And Php

  • 2,607 views
Uploaded on

Palestra do Latin America CICS Roadshow

Palestra do Latin America CICS Roadshow

More in: Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,607
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
44
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CICS and Web 2.0 Tom Grieve [email_address]
  • 2. Outline
    • What is Web 2.0 and what is a RESTful SOA?
    • Why is this relevant to CICS and CICS applications
    • How to use Atom to make CICS information available to more end-users
  • 3. Outline
    • What is Web 2.0 and what is a RESTful SOA?
    • Why is this relevant to CICS and CICS applications
    • How to use Atom to make CICS information available to more end-users
      • What is Web 2.0 and what is a RESTful SOA?
  • 4. What is Web 2.0*? Simple to use Simple to access
    • AJAX
    • Highly Interactive
    • Browser invoked services
    • JSON / XML / ATOM
    • Information exchange
    • JavaScript Friendly
    • REST
    • Easily invoked
    • HTTP-Centric Patterns
    * A term coined by Tim O‘Reilly ( http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html ) ‏
  • 5. What is Web 2.0?
    • From Wikipedia...
      • Web 2.0, a phrase coined by O'Reilly Media in 2003 and popularized by the first Web 2.0 conference in 2004, refers to a perceived second generation of web-based communities and hosted services — such as social-networking sites, wikis and folksonomies — which facilitate collaboration and sharing between users. O'Reilly Media titled a series of conferences around the phrase, and it has since become widely adopted.
      • Although the term suggests a new version of the World Wide Web, it does not refer to an update to Web technical specifications, but to changes in the ways systems developers have used the web platform. According to Tim O'Reilly, "Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform."
      • (continued) ‏
  • 6. What is Web 2.0?
      • Advocates of the concept suggest that technologies such as weblogs, social bookmarking, wikis, podcasts, RSS feeds (and other forms of many-to-many publishing), social software, Web APIs, Web standards and online Web services imply a significant change in web usage. As used by its supporters, the phrase "Web 2.0" can also refer to one or more of the following:
        • the transition of web sites from isolated information silos to sources of content and functionality, thus becoming computing platforms serving web applications to end-users;
        • a social phenomenon embracing an approach to generating and distributing Web content itself, characterized by open communication, decentralization of authority, freedom to share and re-use, and "the market as a conversation";
        • enhanced organization and categorization of content, emphasizing deep linking;
        • a rise in the economic value of the Web, possibly surpassing the impact of the dot-com boom of the late 1990s.
  • 7. Accessibility for Developers
    • A RESTful Web service is formed like a sentence – it simplifies how developers access services
    • Verb = HTTP Action (GET, POST, PUT, DELETE) ‏
    • Noun = the URI of the Service (the document) ‏
    • Adjective = MIME type of the resulting document
  • 8. RESTful SOA
    • A RESTful SOA is an instance of SOA that uses concepts from the Web as the primary service architecture
      • Limiting choices to make it easier to implement a SOA
      • Primarily uses REST to represent and access services
      • Data is encoded as JSON or XML (including XML schemas like ATOM) ‏
      • May use alternate approaches like JSON-RPC when appropriate
      • Supports Rich User Interfaces built using AJAX
    • Key aspects of building an effective RESTful SOA
      • Take advantage of your existing infrastructure wherever possible
      • Use well-established, ubiquitous technologies for scalability, performance and security
      • Build rich UI’s that run in any commodity browser
      • Make content simple and human readable
  • 9. Where can a RESTful SOA apply?
    • When building Widgets for use in Mashups or RIA’s, or building feeds ( ATOM or RSS) for use in a browser or by an aggregator
    • When you want to make assets available to the web
      • In a form that it can be parsed by the widest range of technologies available
      • Where it may be consumed on either the client or server side
    • When the asset you are exposing is naturally resource-oriented
  • 10. What’s the philosophical difference?
    • The key motivator of a RESTful SOA is its simplicity and its ubiquity
      • It’s about delivering content in the simplest possible way
      • HTTP is available everywhere; it’s like the air around us
    • With WS-* It’s not the body that matters, it’s the headers
      • WS-Security is about choice in the decision of encryption, identity tokens and digital signatures
      • WS-Addressing is about transport-neutral mechanisms of describing addresses
      • Even the WS-I standards are about allowing maximum flexibility within a fully agreed-upon framework of standards
    • You might want to choose WS* where you don’t have direct control of all the pipes.
      • WS-ReliableMessaging and SOAP over JMS are about choice in how you obtain qualities of service
  • 11. Merging Enterprise SOA and RESTful SOA
    • If you take the route of developing for both Enterprise SOA and RESTful SOA then you can take advantage of two separate content pools
      • Services generated inside your enterprise
      • Services generated outside the enterprise
    • This gives you the best of both worlds and allows you to take advantage of all the communities served by your business
    Services from Inside the Enterprise Services from outside the Enterprise New Content and New ways to reach Your communities
  • 12. Attributes and advantages of a RESTful SOA
    • Simplicity
      • Many decisions pre-made, constrained choices
        • Fixed protocol (HTTP) ‏
        • Fixed encryption model (HTTPs) ‏
        • Fixed identity token exchange (Basic-Auth or standard HTTP schemes) ‏
    • Ubiquity
      • Use the HTTP infrastructure and other technologies like JavaScript that already exist
    • Effortless use of services
      • Single, well-understood programming model (Javascript) ‏
      • Lots of examples on the web
        • Copy-cut-and-paste programming to use services
      • Someone should be able to use a RESTful SOA Service without knowing they’re doing it!
    • Cacheability, Scalability, Testability, Securability, Navigability
  • 13. Intuitive User Experience – using AJAX In the typical web application, each request causes a complete refresh of the browser page An Ajax application begins the same way. After the initial page loads, Javascript code retrieves additional data in the background and updates only specific sections of the page
    • AJAX is the acronym for A synchronous J avaScript a nd X ML
    • AJAX forces you to think about discrete services
    • Gives you a bottoms-up approach to defining services that can reveal new things about your enterprise
    Service
  • 14. XML, JSON and ATOM
    • XML is the standard representation for message format in RESTful services
      • The key difference from SOAP is that the XML represents only the body of a message
      • Thus a RESTful service will carry as its content only a simple, human-readable document that represents the “noun” of the service
    • JSON is an alternate standard format for succinct communication with AJAX clients
      • The vast majority of the clients of a RESTful service will be written in JavaScript
      • In recognition of that, JSON (JavaScript Object Notation) allows for rapid exchange of JavaScript objects, but also in a simple, human-readable format
      • JSON is built up from a collection of name-value pairs and ordered lists of values
    • ATOM is a key XML specification for content syndication
      • ATOM allows for better support for podcasting, updating, and extension than RSS provided
      • ATOM is also human readable and is easy to understand and parse
  • 15. Extend your business processes
    • For your services to be useful they have to be reused; one of the key promises of a SOA is that it enables your enterprise for BPM
    • Many businesses act as though their business processes end at the corporate firewall; to take advantage of your business communities you need to extend your business processes out to your communities.
    • This entails several aspects
      • Make sure that you can expose your processes (and their results) to your communities
      • Make sure that you can consume RESTful services in your business processes
    • This is possible today through existing tools and RESTful approaches; but can be made simpler in future products and product releases
  • 16. WebSphere sMash for quickly delivering Web 2.0 applications, and enabling mashups. WebSphere sMash
    • Improves developer productivity and efficiency through the support of dynamic scripting languages (Groovy and PHP) ‏
    • Leverages Web 2.0 technologies for service invocation, service composition and data interchange 
    • Visual tools for developers to build Widgets for use in Lotus Mashups
  • 17. Outline
    • What is Web 2.0 and what is a RESTful SOA?
    • Why is this relevant to CICS and CICS applications
    • How to use Atom to make CICS information available to more end-users
      • Why is this relevant to CICS and CICS applications
  • 18. What does this mean to CICS?
    • As far as CICS goes there are at least two ways that Web 2.0 can intersect with it:
      • Customers wanting to employ CICS apps as part of their Web 2.0 solution (CICS Customer Web 2.0)‏
      • Use of Web 2.0 technologies in the CICS portfolio of products and tools (CICS TS Web 2.0)‏
    • Elements of Web 2.0 that we ought to consider:
      • Enabling CICS apps in Mashups - typically browser or portal based aggregations
      • Enabling CICS apps to be Web Feeds
      • Encouraging the building of RESTful access to CICS applications
        • Using REST in our external APIs (e.g. systems management)‏
  • 19. URLs, RESTful and tagging
    • “ Clean and meaningful URLs”
      • For everything!
    • REST
      • REpresentational State Transfer - See http://en.wikipedia.org/wiki/Representational_State_Transfer
      • How the Web has always worked...
        • HTTP POST|GET|PUT|DELETE are all the verbs you'll ever need
        • Everything else is a resource – with a representation of its state
    • Tagging
      • “ Remembering in public”
      • Associating audience-defined terms to things so that dynamic collections are formed
  • 20. An example of CICS supporting a customer Web 2.0 application
    • CICS applications as Atom Feeds
      • Atom feeds provide access to data. CICS apps typically add some business level value over the top of raw database or file records.
      • Examples of what a feed could publish include:
        • New entries in file or table
        • Contents of a queue
        • ... what else?
    • These in turn could have business value as new orders, new customers....
      • An illustration of what could be useful would be to provide an Atom feed that represents a Temp Stg queue. A CICS app then has a very simple way to populate a feed - simply write to the queue.
  • 21. An example of CICS supporting a Web 2.0 application CICS COBOL APP EXEC CICS WRITEQ TS CICS TS v3 CICS Atom Server Simple HTTP application Atom (HTTP) ‏
  • 22. WEB 2.0 and ATOM
    • ATOM feeds are the basis for other Web 2.0 technology
      • Mashups, feed aggregators, blogs all support ATOM
    • Replaces previous RSS syndication standard
    • Comes in two flavours:
      • RFC4287 - Atom Syndication Format (2005) ‏
        • Feeds and Entries
        • Targetted at producing feeds
      • RFC5023 - Atom Publishing Protocol (2007) ‏
        • Services and Collections
        • Targetted to creating and updating resources
  • 23. Using Atom Publishing Protocol to discover services and data AtomService Workspace Collection Entry <?xml version=&quot;1.0&quot; encoding='utf-8'?> <service xmlns=&quot;http://purl.org/atom/app#&quot;> <workspace title=&quot;My blog&quot; > <collection title=&quot;My blog entries&quot; href=&quot; http://example.org/reilly/main &quot; > <accept> entry </accept> </collection> <collection title=&quot;Pictures&quot; href=&quot; http://example.org/reilly/pic &quot; > <accept> image/* </accept> </collection> </workspace> </service> Service Document Finding and filtering Returning refs to 'real' things <feed xmlns=&quot;http://www.w3.org/2005/Atom&quot; xml:base=&quot;http://example.org/blog/entries&quot;> <id>http://example.org/blog/entries</id> <title>My Blog Entries</title> <updated>2006-08-12T13:40:03Z</updated> <link rel=&quot;self&quot; href=&quot;/blog/entries&quot; /> <link href=&quot;http://blog.example.org&quot; /> <entry> <id>tag:example.org,2006:/blog/entries/1</id> <title>Atom-Powered Robots Run Amok</title> <link href=&quot;http://example.org/2003/12/13/atom03&quot;/> <link rel=&quot;edit&quot; href=&quot;http://example.org/blog/entries/1&quot; /> <updated>2006-08-12T13:40:03Z</updated> <author><name>James</name></author> <summary>Some text.</summary> </entry> <entry> ... </entry> ... </feed>
  • 24. Create, Read, Update, Delete with Atom
    • HTTP defines the operations
      • POST to create entries and specific resources
      • GET to read
        • Service Documents
        • Collections
        • Specific resources
      • PUT to update entries and specific resources
      • DELETE to delete entries and specific resources
  • 25. Create, Read, Update, Delete with Atom
    • HTTP defines the operations
      • POST to create entries and specific resources queue elements, records, rows, application objects,...
      • GET to read
        • Service Documents
        • Collections of entries on a queue, records in a file, rows in a table, application defined objects, ...
        • Specific resources queue elements, records, rows, application objects,...
      • PUT to update entries and specific resources queue elements, records, rows, application objects,...
      • DELETE to delete entries and specific resources queue elements, records, rows, application objects,...
  • 26. Coping with lots of data
    • GET against a feed representing your customer database might return a very large number of entries!
    • Atom employs a simple, but powerful, paging scheme....
      • <feed xmlns=&quot;http://www.w3.org/2005/Atom&quot;>
      • <link rel=&quot;next&quot; href=&quot;http://example.org/entries/60&quot; /> ! URI for the next page
      • <link rel=&quot;previous&quot;href=&quot;http://example.org/entries/20&quot; /> ! URI for the prev page
      • ...
      • <entry> ... </entry>
      • <entry> ... </entry>
      • ...
      • </feed>
    • Of course, the collection could be a subset defined by the URI
        • http://winmvs2c.hursley.ibm.com/atom/cicsfile/filea? s=66666
  • 27. Outline
    • What is Web 2.0 and what is a RESTful SOA?
    • Why is this relevant to CICS and CICS applications
    • How to use Atom to make CICS information available to more end-users
      • How to use Atom to make CICS information available to more end-users
  • 28. CICS and Atom on Transaction Server V3
    • To get early exposure, a SupportPac (CA8K) ‏
      • Runs on CICS TS 3.1 and 3.2
      • Category 2
      • Released 20 th March 2008
      • Prereqs:
        • PTF UK34429 on CICS TS V3.1 or PTF UK34459 on CICS TS V3.2, for APAR PK58721
        • PTF UA31443 on z/OS V1.7, for APAR OA16303, or a later release of z/OS
      • See http://www.ibm.com/support/docview.wss?fdoc=aimcics&rs=1083&uid=swg24018619
    • Peter Havercan gave a teleconference entitled &quot;Extending SOA and CICS with Web 2.0&quot; on 11 June 2008. This teleconference explained how, with SupportPac CA8K, you can use existing CICS Web support facilities to deliver Atom feeds containing data from CICS.
      • To listen to the replay, go to http://www.ibm.com/software/os/systemz/telecon/11jun/index.html
  • 29. Design for SupportPac CA8K
    • The resource to be published is specified in an XML configuration file
    • Only a portion of the CICS resource needs to be exposed as an ATOM entry
      • For example a single file record, or queue item, or a range of records or items
    • The selection of the resource portion is identified by the URL querystring:
        • http://winmvs2c.hursley.ibm.com/atom/cicsfile/filea? s=66666
    • Any XML parsing exploits the z/OS XML System Services
  • 30. Design for SupportPac CA8K (cont) ‏ PIPELINE: CONFIGFILE(/x/config/filea) ‏ <handler_parameter_list> <atomfeed xmlns=&quot;http://www.ibm.com/software/htp/cics/atompipe&quot;> <atom:feed xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot;> <atom:id>tag:ibm.com/cics/702134</atom:id> <atom:title>My CICS feed</atom:title> <atom:link rel=“self” href=“/atom/cicsfile/filea”> <atom:entry> <atom:id>tag:ibm.com/cics/702138</atom:id> <atom:title>Title for the entry</atom:title> </atom:entry> </atom:feed> </atomfeed> <cics_resource name=&quot;FILEA&quot; type=&quot;file&quot; key=&quot;NUMB&quot;> <layout>...</layout> </cics_resource> </handler_parameter_list> URIMAP: PATH(atom/*) ‏ USAGE(PIPELINE) ‏ TCPIPSERVICE: PROTOCOL(HTTP) ‏ IPADDRESS(nnn...) ‏
  • 31. Mapping XML to resource data
    • Data from Atom is character-based data imbedded within XML
    • Data in the CICS resource is in binary or packed-decimal form
    • Bi-directional conversion is needed
    • Similar to the problem that is already addressed in existing CICS Web Services support
  • 32. Mapping XML to CICS resource binary data
    • The CICS resource layout is described by a DFDL specification within the pipeline configuration file
    • DFDL (Data Format Description Language) ‏
      • Superset of XML schema language
      • Being specified by Open Grid Forum working group
      • See http://forge.gridforum.org/projects/dfdl-wg/
  • 33. Example of DFDL specification
    • <xs:element name=&quot;sbyte&quot; type=&quot;xs:byte&quot; dfdl:length=&quot;1“
    • />
    • <xs:element name=&quot;comment&quot; type=&quot;xs:string&quot; dfdl:length=&quot;16“
    • />
    • <xs:element name=&quot;packnum&quot; type=&quot;xs:decimal&quot; dfdl:length=&quot;16&quot;
    • xs:fractionDigits=&quot;2&quot;
    • dfdl:decimalFormat=&quot;packed&quot;
    • dfdl:decimalSigned=&quot;false“
    • />
  • 34. Implementing “Read for Update”
    • READ for UPDATE cannot hold a lock over an HTTP GET/PUT sequence, so a “conditional PUT” has been implemented:
    • GET returns an HTTP Etag header
      • Etag value uniquely identifies the response instance returned
      • In this implementation, it is a checksum value
    • PUT request sends the same Etag value in an If-Match header
      • If resource has changed, HTTP response 412 (Precondition failed) is returned, and update is not performed
  • 35. Requirement for D-type APAR
    • Current PIPELINE support is SOAP oriented
      • HTTP methods GET and DELETE diagnosed as errors
        • Pipeline expects Content-Type header
      • MEDIATYPE of HTTP response is assumed to be SOAP
        • Needs new DFHMEDIATYPE container
      • HTTP status code cannot be set within the handler application
        • Needs new DFHHTTPSTATUS container
      • Also need to recognize JavaScript and JSON mediatypes as text
        • for correct codepage conversion
      • Fixes for above will be available in CICS APAR PK58721
  • 36. ATOM support in CICS TS 4.1 http://winmvs2c.hursley.ibm.com/atom/cicsfile/filea URIMAP PATH(atom/*) ‏ USAGE(ATOM) ‏ ATOMSERVICE ATOMTYPE(FEED) ‏ STATUS(ENABLED) ‏ RESOURCENAME(FILEA) ‏ RESOURCETYPE(FILE) ‏ BINDFILE CONFIGFILE XSDBIND file <cics:atomservice type=&quot;feed“ <cics:feed cics:window=&quot;window-size&quot;> <cics:resource name=“FILEA&quot; type=“FILE“/> . . . <atom:feed xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot;> . . . . <atom:content cics:resource=&quot;cics-resource-name&quot; cics:type=&quot;cics-resource-type&quot;/> </atom:feed> </cics:atomservice>
  • 37. AtomService CONFIGFILE
    • Specify the CICS resource attributes of the feed
    • <cics:atomservice type=“typevalue”>
      • Root element for an Atom configuration file and the type of Atom document
        • feed, collection, service, category
    • For feed documents: <cics:feed cics:window=&quot;window-size&quot;>
        • Specify the number of entries that CICS is to return in each feed document
      • <cics:resource> name=&quot;cics-resource-name&quot; type=&quot;cics-resource-type“>
        • Specify name and type of CICS resource to be published
          • tsqueue, file
        • Or provide a program to create data from any source
          • DB2, custom data store etc.
      • <cics:fieldnames>
        • Identify the CICS resource field names that provide items of metadata
  • 38. AtomService BINDFILE
    • CICS Utility DFHLS2SC
      • Generates an XML schema and an XSD binding file from a language structure
      • XSD bind file will describe the record layout of the CICS resource used as a feed
        • Maps the contents of the TS queue or File record etc. onto the Atom protocol XML.
  • 39. Systems Programmer Interface for Atom Feeds
    • CREATE ATOMSERVICE
    • DISCARD ATOMSERVICE
    • INQUIRE ATOMSERVICE
    • SET ATOMSERVICE
    • INQUIRE URIMAP
    • New CW2A Transaction ID
      • Alias transaction for Atom feeds
  • 40. Summary and Lessons Learned
    • We’ve seen:
      • What is Web 2.0 and What is a RESTful SOA?
      • Extending the Reach of SOA with IBM Products and a RESTful SOA
        • WebSphere App Server, WebSphere sMash, WebSphere MQ, WebSphere Commerce, DataPower,…
      • How CICS is enabling your existing enterprise data and applications to participate in this TODAY!
    • Principles for a RESTful SOA
      • Unleash everything
      • Design with REST in mind first
      • Complements Enterprise SOA
      • Take advantage of your business communities
  • 41. References
    • ATOM
      • http://rollerweblogger.org/downloads/presentations/TriXML2006-BeyondBlogging.pdf
    • REST
      • http://doc.opengarden.org/REST/REST_for_the_Rest_of_Us
    • CICS Supportpac CA8K
      • http://www.ibm.com/support/docview.wss?fdoc=aimcics&rs=1083&uid=swg24018619
    • Tagging
      • http://infotangle.blogsome.com/2005/12/07/the-hive-mind-folksonomies-and-user-based-tagging/
    • ProjectZero
      • http://www.projectzero.org
    • Google's Gdata
      • http://code.google.com/apis/gdata/index.html
    • Lotus Connections and Atom
      • http://www.ibm.com/developerworks/lotus/library/connections-deploy-pt6/
  • 42. CICS news delivered to your Inbox
    • Find out what’s on the mind of other CICS users, industry analysts and CICS decision makers
    • Learn about the latest CICS innovations and releases
    • Get information about up to date CICS training opportunities and events
    • Grab the CICS papers hot off the press
    • Feedback directly to CICS people
    • … for all these and more, join the growing list of people who subscribe to
    • ibm.com/ cics/enews