23
Page 1 ZIG Tutorial, Stockholm August 1999 XML Encoding Rules (XER) Rob Bull Rob Bull [email protected] [email protected]

ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull [email protected]

Embed Size (px)

Citation preview

Page 1: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 1ZIG Tutorial, StockholmAugust 1999

XML Encoding Rules (XER)

Rob Bull [email protected] Bull [email protected]

Page 2: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 2ZIG Tutorial, StockholmAugust 1999

Original Requirements...

An immediate need (Nov. 1998): An abstract specification of search was

needed to respond to the OpenGIS Consortium RFP for Catalog Services - CORBA, COM, Z39.50, SQL, and LDAP)

XML (eXtensible Markup Language) chosen as the notational syntax for the Catalog Services search specification

Page 3: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 3ZIG Tutorial, StockholmAugust 1999

Basic Concept of XER

Rules to convert between XML and BER (Basic Encoding Rules) for a protocol specified in ASN.1 (Abstract Syntax Notation)

Standardized rules for transforming: BER encoded structures into equivalent XML

structures XML encoded structures into equivalent BER

structures

Page 4: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 4ZIG Tutorial, StockholmAugust 1999

Scope...

ASN.1 is used in a variety of applications, protocols, and network environments with various encoding rules (e.g., BER, PER, DER)

XML provides a facility for representing character string structures and their markup rules

initial XER focus is Z39.50-1995 (ISO 23950) Search and Retrieval protocol

In the Z39.50 community: ASN.1 is used with BER

potentially applicable to LDAP (lightgweight directory access protocol) and SNMP (simple network management protocol)

Page 5: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 5ZIG Tutorial, StockholmAugust 1999

For example...

PDU ::= CHOICE{searchRequest [22] IMPLICIT SearchRequest,searchResponse [23] IMPLICIT SearchResponse,

SearchRequest ::= SEQUENCE{resultSetName [17] IMPLICIT InternationalString,databaseNames [18] IMPLICIT SEQUENCE OF

DatabaseName, query [21] Query

SearchResponse ::= SEQUENCE{ resultCount [23] IMPLICIT INTEGER, numberOfRecordsReturned [24] IMPLICIT INTEGER, nextResultSetPosition [25] IMPLICIT INTEGER, searchStatus [22] IMPLICIT BOOLEAN, resultSetStatus [26] IMPLICIT INTEGER, records Records OPTIONAL,

Page 6: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 6ZIG Tutorial, StockholmAugust 1999

XML Encoding: SearchRequest

<?xml version='1.0' ?><search xmlns="urn:oid:1.2.840.10003.2.1"> <searchRequest> <resultSetName> 1 </resultSetName> <databaseNames> xxdefault </databaseNames> <query> [ query on next slide ] </query> </searchRequest></search>

Page 7: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 7ZIG Tutorial, StockholmAugust 1999

XML Encoding: Query Detail

<query> <type-1> <rpnQuery> <attributeSet> BIB1 </attributeSet> <rpn> <rpn> [operand next slide] </rpn> <rpn> [operand next slide] </rpn> <operator> AND </operator> </rpn> </rpnQuery> </type-1></query>

Page 8: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 8ZIG Tutorial, StockholmAugust 1999

XML Encoding: Operand Detail

<operand>

<attributeValue> CreationDate </attributeValue> <attributeValue> Greater Than or Equal </attributeValue> <attributeValue> Date </attributeValue> <term> 1995-01-01 </term>

</operand>

Page 9: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 9ZIG Tutorial, StockholmAugust 1999

XML Encoding: SearchResponse

<?xml version='1.0' ?><search xmlns="urn:oid:1.2.840.10003.2.1"> <searchResponse> <resultCount> 76 </resultCount> <numberOfRecordsReturned>0

</numberOfRecordsReturned> <nextResultSetPosition> 0

</nextResultSetPosition> <searchStatus> <true/></searchStatus> </searchResponse></search>

Page 10: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 10ZIG Tutorial, StockholmAugust 1999

Development Approach...

e-mail list to discuss XER design and issuesParticipants/listeners include:

commercial (large, small)desktop software suppliers, telecoms suppliersdatabase software suppliersZ39.50 and ASN.1 toolkit suppliers and consultants

academic research

Xer syntax and rules have been discussed and a draft set of rules created

Page 11: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 11ZIG Tutorial, StockholmAugust 1999

Development Approach...

Software developedProfile for Z39.50 over HTTP discussion paperPresentation to ASN.1 committee at Geneva in

June 1999

has already spawned interest such as ONE-2 project

Page 12: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 12ZIG Tutorial, StockholmAugust 1999

Decisions and Proposals...

Three categories of decisions and proposals: decisions where consensus is reached

proposals that generally affect XER

proposals that specifically affect XER and Z39.50

Page 13: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 13ZIG Tutorial, StockholmAugust 1999

Consensus Reached...

The XER generated XML should be readily understandable

XER is generally applicable to ASN.1XER requires well-formed XMLNo distinction between explicit, implicit

encode and decode assumes XER is implicit applications need to know ASN.1 and can make

BER implicit or explicit ASN.1 1994 has concept of automatic tags

Page 14: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 14ZIG Tutorial, StockholmAugust 1999

Consensus Reached...

named values as empty elements, so its not:<protocolVersion>version-1, version-2</protocolVersion> but it is:<protocolVersion><version-1/><version-2/></protocolVersion>

uses XML namespace attribute to identify particular XMLnon-validating

some aspects of the XML record structure can be inferred from well-formed values

beyond the inferred structure various methods exist, there is always the base ASN.1 specification for validation

Page 15: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 15ZIG Tutorial, StockholmAugust 1999

Proposals...

XML namespace decisionsadding private PDUshow to represent tags for OIDsTestbed

z39.50 client (BER) BER/XER gateway (XER) XER/BER gateway (XER) Z39.50 server (BER)

Page 16: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 16ZIG Tutorial, StockholmAugust 1999

Draft XML Encoding Rules

7.1 General rules for encoding7.2 Encoding of a boolean data value7.3 Encoding of an integer data value7.4 Encoding of an enumerated data value7.5 Encoding of a real data value7.6 Encoding of a bitstring data value7.7 Encoding of an octetstring data value7.8 Encoding of a null data value7.9 Encoding of a sequence data value7.10 Encoding of a sequence-of data value7.11 Encoding of a set data value7.12 Encoding of a set-of data value

Page 17: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 17ZIG Tutorial, StockholmAugust 1999

Draft XML Encoding Rules

7.13 Encoding of a choice data value7.14 Encoding of a ASN.1 tagged data value7.15 Encoding of an open type7.16 Encoding of an instance-of data value7.17 Encoding of a data value of the embedded-pdv type7.18 Encoding of an object identifier data value7.19 Encoding of a data value of the external type7.20 Encoding for data values of the restricted character string

types7.21 Encoding for data values of the unrestricted character string

type7.22 Encoding for data values of the any character string type7.23 Encoding for data values of the general string type7.24 Encoding for data values of the visible character string type

Page 18: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 18ZIG Tutorial, StockholmAugust 1999

Profile for Z39.50 over HTTP

Discussion paper, second draft, April 1999Architectural Issues:

Z39.50 is described in ASN.1 but encoding is via XER

requirement for stateful/stateless applicationsstateless - single HTTP request/response

sequence comprises an entire Z-associationstateful - a Z-association is maintained

across multiple TCP/IP sessions Z39.50 PDUs will be encapsulated within HTTP

protocol messages using the “Search” method

Page 19: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 19ZIG Tutorial, StockholmAugust 1999

Profile for Z39.50 over HTTP

proposed approaches to mapping HTTP requests and responses to Z39.50 requests and responses

considerations for: stateful, stateless Z39.50 state-machine how do we handle “trickier” services such as

access control, resource control, segmentation, trigger resource control

Page 20: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 20ZIG Tutorial, StockholmAugust 1999

Software Developed so far...

European Commission, Joint Research Centre, Ispra, Italy: On http://perlz.jrc.it/ a library for handling XER

encoded packets with Perl is available The Z39.50 library contains, as an example, a

gateway from XER to BER and back

BER to XML conversion library (Warnock/ Gamiel) demonstration utility, software

description

Page 21: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 21ZIG Tutorial, StockholmAugust 1999

Opportunities….

XML developers leverage investments in ASN.1-based

applications already interoperable

ASN.1 developers leverage investments in XML-based

applications coming up on the Internet

Page 22: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 22ZIG Tutorial, StockholmAugust 1999

Further information...

XER home page http://asf.gils.net/xer with pointers to: documentation on XER concept details on rules defined software example PDUs decisions and proposals XER discussion list and the list archive

Profile for Z39.50 over HTTP: http://lcweb.loc.gov/z3950/agency/zhttp.html

Page 23: ZIG Tutorial, StockholmAugust 1999 Page 1 XML Encoding Rules (XER) Rob Bull bull@crxnet.com

Page 23ZIG Tutorial, StockholmAugust 1999

Credits...

This presentation incorporates content from a presentation to the

ASN.1 Committee Geneva, June 9, 1999 byEliot Christian, U.S. Geological Survey and Nick Hibma, E.C. Joint Research Commission