1.4k likes | 2.36k Views
Web Service and Related Technologies in Directory Integrator (TDI). Lak Sri laksri@us.ibm.com. XML with TDI –Topic 1. XML terminology XML Parsers available in TDI Shallow and Deep options XML Validation XML and XSL/XSLT Creating XML Using Parser Using Scripts Using EMF SDO FC.
E N D
Web Service and Related Technologies in Directory Integrator (TDI) Lak Sri laksri@us.ibm.com
XML with TDI –Topic 1 • XML terminology • XML Parsers available in TDI • Shallow and Deep options • XML Validation • XML and XSL/XSLT • Creating XML • Using Parser • Using Scripts • Using EMF SDO FC
DSML over HTTP with TDI – Topic 2 • HTTP protocol overview • DSMLv2 and IdM (Identity management) • DSML Event Handler • Sun setting in TDI 7.0 • HTTP based Alternative for Event Handler • Strategies to overcome bottlenecks over HTTP • Using Fire and Forget • Using Sequencing • Using RMI based adapter • Security in the HTTP world and IDI’s role in EAI
Web Service with TDI – Topic 3 • Why Web Services • Web Service Concepts and Standards • Web Service Suite in TDI • Setting up Web Services Server • Setting up Web Services Client • Handling Complex Types • Beyond Transport level security • Precautions to take in WS environemnt
XML with TDI –Topic 1 • XML terminology • XML Parsers available in TDI • Shallow and Deep options • XML Validation • XML and XSL/XSLT • Creating XML • Using Parser • Using Scripts • Using EMF SDO FC
XML Support in TDI Topic 1
TDI 6.1.1 Server AssemblyLine Active Correlation Technology Connector Generic Log Adapter Connector RAC Connector Entry to CommonBaseEvent Function Axis Easy Web Service Server Connector Axis Easy Web Service Invoke Axis Java-to-Soap Invoke Soap Web Service Axis Soap-to-Java Complex Types Generator Wrap Soap LDAP Connector LDAP Server Connector Tivoli Access Manager Connector Windows Users and Groups Connector Active Directory Changelog Connector v2 IBM Directory Server Changelog Connector Netscape/iPlanet Changelog Connector zOS LDAP Changelog Connector BTree Connector JDBC Connector Properties Connector SystemStore Connector RDBMS Changelog Connector AssemblyLine Connector Server Notifications Connector AssemblyLine Function Component Domino Change Detection Connector Domino Users Connector Lotus Notes Connector Exchange Changelog Connector Mailbox Connector SendEMail Function Component TIM DSMLv2 Connector DSMLv2 SOAP Connector DSML v2 SOAP Server Connector Generic JNDI Connector ITIM Agent Connector EMF SDOToXML Function Component EMF XMLToSDO Function Component JMX Connector SNMP Connector SNMP Server Connector TCP Connector TCP Server Connector SAP ALE IDoc Connector SAP R/3 Business Object Repository SAP R/3 User Registry SAP R/3 RFC Functional Component Script Connector Generic Java Method Parser FC Scripted Function Component Timer Connector Remote Command Line Function Component z/OS TSO/E Command Line Function Component Command Line Connector Memory Queue FC MemQ Connector Memory Stream Connector File System Connector FTP Client Connector URL Connector HTTP Client HTTP Server Connector IBM MQ Series Connector JMS Pub/Sub Connector MQe Password Store Connector System Queue Connector CSV Parser DSML v1 Parser DSML v2 Parser Fixed Record Parser HTTP Parser LDIF Parser Line Reader/Writer SOAP Parser Script Parser Simple Parser XML Parser XML Sax Parser XSL based XML Parser JVM on Windows, Linux, AIX, iSeries, zOS, Sun, HP
XML Sources and Dialects • XML Data Sources • Files System, URL, Memory, Web Service • Messages: HTTP, JMS / WebSphere MQ • Repositories : LDAP directories, RDBMS • Applications: TAMeb, FIM, web pages • XML dialects (Markup Languages) • Identity management • DSML • SPML • Web Services • SOAP • Security • SAML
XML • eXtensible Markup Language • Metalanguage - used to create other languages • Has become a universal data-exchange format • You need to ensure that XML is • Well-Formed: Structure follows XML syntax rules • Valid: Structure conforms to a Schema
What is a XML Node ? • An XML node is a tree, containing an open tag, contents, and a close tag • <foo id=“123”>This is <bar>an element</bar></foo> • Here, the tag named ‘foo’ encloses the contents and attributes of the Node • In this case node with the tag ‘foo’ contains a node with the tag ‘bar’ also. There is another notion used in XML literature called Element, that is skipped here to keep things simple
XML is a Nested Tree Order Node Depicted <?xml version="1.0" encoding="UTF-8" standalone="no"?> <IBM> <eFruit> <FruitSales> <Order> <OrderId OrderState="ReadOnly">E0001DU9</OrderId> <Items> <Fruit> <FruitName>Grapes</FruitName> <FruitCount>12</FruitCount> </Fruit> <Fruit> <FruitName>Apples</FruitName> <FruitCount>3</FruitCount> </Fruit> </Items> </Order> </FruitSales> </eFruit> </IBM> OrderID items items OrderState fruit fruit fruitname fruitcount • Nodes • Branch nodes contain children • Leaf nodes contain content • Attributes, Values, etc. attribute & value element & content
XML is a Nested Tree - 2 Result Order@OrderId:E0001DU9 Order@OrderId#OrderState:ReadOnly Order@Items@Fruit@FruitName:Grapes|Apples Order@Items@Fruit@FruitCount:12|3
XML Syntax • Tags properly nested • Tag names case-sensitive • All tags must be closed • or self-closing • <foo/> is the same as <foo></foo> • Attributes enclosed in quotes • Document consists of a single (root) element
Advantages of XML • Machine-readable (easy to parse) • Standard format for data interchange • Possible to validate • Extensible • can represent any data • can add new tags for new data formats • Hierarchical structure (nesting) • Manageable with tools
TDI’s XML related support • Parsers • XML Sax Parser • XML DOM Parser • XSL based XML Parser • DOM Scripting with JAXP • system object methods [xslTransform()] • EMF SDO FC
Using the SAX Parser XML Document Driving Code Parser Processing code (handlers) StartElement Characters etc.
Using DOM XML Parser TDI DOM Parser n-Node Tree Default TDI Code performs two levels by default Custom Script to perform n level tree traversal
Data persists in memory “Random access” can go forwards and backwards Can read and write In-place updates Small memory usage Does not read the whole document, just the parts needed Read only Can parse a non-well formed document DOM vs Sax
Using xmldom object -3 <Fruit> <FruitName>Mango</FruitName> <FruitCount>12</FruitCount> </Fruit>
XML Schemas • “Schemas” is a general term--DTDs are a form of XML schemas • When we say “XML Schemas,” we usually mean the W3C XML Schema Language • This is also known as “XML Schema Definition” language, or XSD • DTDs, XML Schemas, and RELAX NG are all XML schema languages
Referring to a schema • To refer to a DTD in an XML document, the reference goes before the root element: • <?xml version="1.0"?><!DOCTYPE rootElement SYSTEM "url"><rootElement> ... </rootElement> • To refer to an XML Schema in an XML document, the reference goes in the root element: • <?xml version="1.0"?><rootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"(The XML Schema Instance reference is required) xsi:noNamespaceSchemaLocation="url.xsd">(This is where your XML Schema definition can be found) ...</rootElement>
Sample XML with DTD and XSD Schema XSD XML <?xml version="1.0"?> …… or …. <ste> <presenter>Lak Sri</presenter> <audience>All</audience> <topic>IDI</topic> <theme>how to</theme> </ste> <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace=http://www.ibm.com xmlns=http://www.ibm.com elementFormDefault="qualified"> <xs:element name=“ste"> <xs:complexType> <xs:sequence> <xs:element name="presenter"type="xs:string"/> <xs:element name="audience" type="xs:string"/> <xs:element name=“topic" type="xs:string"/> <xs:element name=“theme" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> DTD <!ELEMENT ste (audience, presenter, topic, theme)> <!ELEMENT presenter (#PCDATA)> <!ELEMENT audience (#PCDATA)> <!ELEMENT topic (#PCDATA)> <!ELEMENT theme (#PCDATA)> Note: PCDATA - parsed character data
Transforming the XML using XSL With system object
Transforming the XML using XSL - 2 Example Output
Transforming the XML using XSL - 3 XSL Transformation XML Data
Transforming the XML using XSL XSL based XML Parser
Transforming the XML using XSL (thru config) - 4 Result Species: Great Tinamou.| Highland Tinamou.| Little Tinamou.| Thicket Tinamou.| Slaty-breasted Tinamou.| Choco Tinamou., Family:TINAMIDAE, Order:TINAMIFORMES Species: Red-throated Loon.| Arctic Loon.| Pacific Loon.| Common Loon.| Yellow-billed Loon., Family:GAVIIDAE, Order:GAVIIFORMES
SDO in a nutshell • Self-contained object graph • Objects can be passed remotely • One API for XML and non-XML data • Generated statically-typed API can be used • DOM-like access possible Previous TDI version: SDO Technology is not available in previous versions of TDI. The EMF XMLToSDO and SDOToXML Function Components are also not compatible with the TDI 6.0 Castor Function Components. Any solution which uses the Castor Function Components needs to be re-implemented in order to work with the EMF XMLToSDO and EMF SDOToXML Function Components.
SDO to XML Config Output Step 1 – Run the HTTP Server to server the XSD files referred 06:04:26 [getxml] CTGDIS505I The 'conn' object 06:04:26 [getxml] CTGDIS003I *** Start dumping Entry 06:04:26 Operation: generic 06:04:26 Entry attributes: 06:04:26 DocRoot@person#sex (replace): 'Male' 06:04:26 DocRoot@person#name (replace): 'Lak Sri' 06:04:26 [getxml] CTGDIS004I *** Finished dumping Entry 06:04:26 [getxml] CTGDIS506I The 'work' object 06:04:26 [getxml] CTGDIS003I *** Start dumping Entry 06:04:26 Operation: generic 06:04:26 Entry attributes: 06:04:26 [getxml] CTGDIS004I *** Finished dumping Entry 06:04:29 [getxml] CTGDIA012I The XML Schema has been successfully parsed and an Ecore model has been created. 06:04:29 [getxml] CTGDIA013I The Entry Attributes have been successfully applied to the data structure. 06:04:29 [getxml] CTGDIA018I The XML that results from conversion from the DOM Element to XML is: <?xml version="1.0" encoding="UTF-8"?> <person xmlns="http://www.ibm.com" sex="Male"> <name>Lak Sri</name> </person>. Step 2 – Run the AL for SDO to XML
DSML with TDI – Topic 2 • HTTP protocol overview • Security in the HTTP world and IDI’s role in EAI • DSMLv2 and IdM (Identity management) • DSML Event Handler • Removal of DSMLv2 EH in TDI 7.0 • HTTP based Alternative for Event Handler • Strategies to overcome bottlenecks over HTTP • Using Fire and Forget • Using Sequencing • Using RMI based adapter
HTTP Technology Review As a DSMLv2 Transport protocol