COOL Gen XML Proxy Interface William RED Davidson






















- Slides: 22

COOL: Gen XML Proxy Interface William “RED” Davidson Development Manager, COOL: Generators Computer Associates October, 2001

Agenda Introduction What is XML? XML for COOL: Gen Proxies Q&A

Disclaimer This presentation contains certain forward-looking statements and information relating to COOL: Gen features that are based on the beliefs and assumptions made by development. When used in this presentation, the words "anticipate, " "believe, " "estimate, " “will, ” and "expect, " and similar expressions, are intended to identify forward-looking statements. Such statements reflect the current views of development with respect to future events and are subject to certain risks, uncertainties, and assumptions. Should one or more of these risks or uncertainties materialize, or should underlying assumptions prove incorrect, actual results may vary materially from those described herein as anticipated, believed, estimated, or expected. The Company does not intend to update these forwardlooking statements.

What is XML?

XML is… e. Xtensible Markup Language A portable way to share information in a consistent way An XML document may contain both the data format as well as the data itself Platform independent World Wide Web Consortium Recommendation, February 1998

XML Uses Tags Looks like HTML (which was based on SGML) Tags identify objects in the document <TITLE> </TITLE> Tag may have attributes defined as name=values pairs FONT=”Tahoma” Extensible; may define your own tags and attributes

DTD Document Type Definition A definition of valid tags, their structure and their meanings – HTML has its own DTD but is never sent with a Web page since all browsers know the DTD Does not say much about the data contents Not implemented in XML

XML Schema A definition of valid tags, their structure and their meanings A definition of data types (i. e. float, currency) Can define more information regarding relationships between tags Can define permitted values and ranges Based upon XML, can define your own tags World Wide Web Consortium Recommendation, May 2001

DOM Document Object Model Object Tree API to allow a programmer to parse and build an XML stream Defines a platform-independent and language-neutral interface World Wide Web Consortium Recommendation

SAX Simple API for XML Event-driven API to allow a programmer to parse an XML stream Faster than DOM, but read only SAX works directly with an XML Parser Programmer specifies an event that may happen and, if it does, SAX gets control and handles the situation.

XSLT e. Xtensible Stylesheet Language Transformations A language for transforming XML documents into other XML documents World Wide Web Consortium Recommendation, November 1999

XML Support for COOL: Gen Proxies

COOL: Gen Proxy Goal Modify COM and Java proxy generation to… – Create an XML Schema for the COOL: Gen Server import and export views – Permitted Values and Ranges – Default Values – Mandatory/Optional – Length/Decimal Precision – Data Types

New COOL: Gen Proxy Methods Generate new methods to exchange XML Streams For Java: void execute. XML(java. io. Reader, java. io. Writer); For COM: HRESULT execute. XML(char *in, long in. Len, char* out, long max. Out. Len, long *out. Len); Equivalent asynchronous methods will also be generated

Proxy Generation XML Schema C++/COM or Java Code Sample Code

Example XML Schema IMPORTS: Entity View in proxy text 1 text 2 <xsd: element name=”SERVER 1” type=”SERVER 1 Type”/> <xsd: complex. Type name=”SERVER 1 Type”> <xsd: choice> <xsd: element name=”request”> <xsd: complex. Type> <xsd: element name=”IMPORT”> <xsd: complex. Type> <xsd: element name=”inproxy”> <xsd: complex. Type> <xsd: element name=”text 1” type=”xsd: string”/> <xsd: element name=”text 2” type=”xsd: string”/> </xsd: complex. Type> </xsd: element>. . .

Example XML Stream <? xml version=” 1. 0”? > <SERVER 1> <request command=“DISPLAY” tracing=“NO”…> <IMPORT> <inproxy> <text 1>Hello</text 1> <text 2>Geneva!</text 2> </inproxy> </IMPORT> </request> </SERVER 1>

Consuming an XML-enabled Proxy Create/parse the XML Streams using the technology of your choice – Standard I/O, DOM, SAX, XSLT, etc. – Be compliant with the generated XML Schema for the target proxy Invoke the generated proxy from your application

XML-enabled Proxy at Runtime Client Application XML Schema Referenced by URL XML Schema XML Interface Generated Proxy COOL: Gen Cooperative Flow COOL: Gen Server

Benefits Exchange XML Stream with COOL: Gen Servers via Proxies Allows a one-call execution of the COOL: Gen Proxy, no more sets/gets May optionally validate the XML Stream via the associated XML Schema Proxy’s XML Schema is external and public Alternative interface to COOL: Gen Proxies; both COM and Java having similar interfaces

Summary XML, XML Schemas, DOM and XSLT are evolving recommendations from the World Wide Web Consortium The COOL: Gen COM and Java Proxies will be modified to generate the XML Schema and exchange XML streams

Thanks for Attending! Questions?