
CSG Mini-Workshop: Web Services Justin Tilton instructional media + magic, inc. As presented at the Common Solutions Group Meeting May 9, 2002 Chicago, Illinois Overview •Data XML • Validation Schema • Transport SOAP • Security SAML •Description WSDL • Directory UDDI •Transformation XSLT JA-SIG Workshop Series Data: XML Overview XML is for structuring data [1] • Structured data includes things like: • spreadsheets, address books, configuration parameters, financial transactions, and technical drawings • XML is a set of rules for designing text formats that let you structure your data. • XML is not a programming language, and you don't have to be a programmer to use it or learn it JA-SIG Workshop Series XML is for structuring data [2] • XML makes it easier for a computer to generate data, read data, and ensure that the data structure is unambiguous • XML avoids common pitfalls in language design: • it is extensible • it is platform-independent • and it supports internationalization and localization JA-SIG Workshop Series XML is a family of technologies [1] • XML 1.0 is the specification that defines what "tags" and "attributes" are • Xlink describes a standard way to add hyperlinks to an XML file • XPointer and XFragments are syntaxes in development for pointing to parts of an XML document • XSL is the advanced language for expressing style sheets. It is based on XSLT JA-SIG Workshop Series XML is a family of technologies [2] • XSLT is a transformation language used for rearranging, adding and deleting tags and attributes • XPath is a language for navigating in an XML document • XML Schemas help developers to precisely define the structures of their own XML-based formats. • XQuery provides flexible query facilities to extract data from real and virtual documents on the Web • XML Signatures provide integrity, message authentication, and signer authentication services for an XML document JA-SIG Workshop Series XML is new, but not that new • Development of XML started in 1996 and has been a W3C Recommendation since February 1998 • Before XML there was SGML, developed in the early '80s, and widely used for large documentation projects • The development of HTML started in 1990. • The designers of XML simply took the best parts of SGML, guided by the experience with HTML, and produced something very powerful JA-SIG Workshop Series HTML and XHTML • The successor to HTML is XHTML • XHTML has almost all of the same elements as HTML, but the syntax has been changed slightly to conform to the rules of XML • XHTML allows "<p>", but not "<r>" since <p> is defined in XHTML and <r> is not • XHTML says that "<p>" stands for "paragraph", and not for "price", "person", or anything else • Emerging applications such as uPortal are using XHTML to output content to browsers JA-SIG Workshop Series XML has namespaces • To eliminate name confusion when combining documents, XML provides a namespace mechanism • XSL and RDF are good examples of XML- based formats that use namespaces • XML Schema is designed to support modularity by defining XML document structures, making it easy to combine two schemas to produce a merged document structure. JA-SIG Workshop Series XML is license-free • XML is license-free, platform- independent and well-supported • A large and growing community of tools and engineers experienced in the technology • Since XML is license-free, you can build your own software around it without fees JA-SIG Workshop Series An example of XML [element] <?xml version="1.0"?> <breakfast_menu> <food> <name>Belgian Waffles</name> <price> <amount>5.95</amount> <currency>US Dollars</currency> </price> <description>two of our famous Belgian Waffles with plenty of real maple syrup</description> <calories>650</calories> </food> <food> <name>Strawberry Belgian Waffles</name> <price> <amount>7.95</amount> <currency>US Dollars</currency> </price> <description>light Belgian waffles covered with strawberries and whipped cream</description> <calories>900</calories> </food> JA-SIG Workshop Series </breakfast_menu> An example of XML [attribute] <?xml version="1.0"?> <breakfast_menu> <food> <name>Belgian Waffles</name> <price currency="US Dollars">5.95</price> <description>two of our famous Belgian Waffles with plenty of real maple syrup</description> <calories>650</calories> </food> <food> <name>Strawberry Belgian Waffles</name> <price currency="US Dollars">7.95</price> <description>light Belgian waffles covered with strawberries and whipped cream</description> <calories>900</calories> </food> </breakfast_menu> JA-SIG Workshop Series Validation: XML Schema Overview What is an XML Schema? • XML Schema is an XML based alternative to Document Type Definition (DTD) • The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD. JA-SIG Workshop Series An XML Schema defines: • Elements and attributes that can appear in a document • Simple child-parent element relationships • The sequence in which the child elements can appear • The number of child elements • Whether an element is empty or can include text • Data types for elements and attributes • Default values for elements and attributes JA-SIG Workshop Series XML Schemas replacing DTDs • We think that very soon XML Schemas will be used in most Web applications as a replacement for DTDs. Here are some reasons: • XML Schemas are richer than DTDs • XML Schemas are written in XML • XML Schemas support data types • XML Schemas support namespaces • XML Schemas are extensible to future additions JA-SIG Workshop Series XML Schema & Data Types • With data type support it is easier to: • Describe permissible document content • Validate the correctness of data • Work with data from a database • Define data facets (restrictions on data) • Define data patterns (data formats) • Convert data between different data types JA-SIG Workshop Series Why Schema is important • A well-formed XML document is a document that conforms to the XML syntax rules • Even if documents are Well-Formed they can still contain errors, and those errors can have serious consequences. • With XML Schemas, most of these errors can be caught by your validating software. JA-SIG Workshop Series XML Schema: Practical The simplest element definition • A schema specifies a set of valid top- level elements. • In the simplest case, we can define an element to describe a name of the city: Schema: <xsd:element name="city" type="xsd:string"/> Document: <city>Washington</city> JA-SIG Workshop Series Another element definition • A schema specifies a set of valid top-level elements. • Complex types can define elements with children: Schema: <xsd:element name="note"> <xsd:complexType> <xsd:sequence> <xsd:element name="to" type="xsd:string"/> <xsd:element name="from" type="xsd:string"/> <xsd:element name="heading" type="xsd:string"/> <xsd:element name="body" type="xsd:string"/> </xsd:sequence> </xsd:complexType> JA-SIG Workshop Series </xsd:element> Another element definition • A schema specifies a set of valid top- level elements. • Complex types can define elements with children: Document: <note> <to>Sam</to> <from>Jack</from> <heading>Your presentation</heading> <body>Please update section II</body> </note> JA-SIG Workshop Series Transport: SOAP Overview What is SOAP? • SOAP is an XML based protocol to let software components and applications communicate using standard Internet HTTP • SOAP stands for Simple Object Access Protocol JA-SIG Workshop Series SOAP is: • A communication protocol • For communication between applications • A format for sending messages • Designed to communicate via internet • Platform independent • Language independent • Based on XML • Simple and extensible • Remote procedure call protocol JA-SIG Workshop Series • SOAP will be developed as a W3C standard Why SOAP? • SOAP is Transport Protocol independent • Transport protocol chosen according to network architecture and type of exchange • Real time over the internet might use HTTP, where a batch processing application might use SMTP • SOAP provides a way to communicate between applications running on different operating systems, with different technologies and different programming languages JA-SIG Workshop Series SOAP was Proposed • UserLand, Ariba, Commerce One, Compaq, Developmentor, HP, IBM, IONA, Lotus, Microsoft, and SAP proposed SOAP to W3C, in May 2000 •TheebXMLPlenary voted on 16 February 2001 to use SOAP 1.1 and SOAP With Attachments as part of the ebXML transport specification • Anyone using the transport portion of ebXML will therefore be using SOAP JA-SIG Workshop Series SOAP Building Blocks • A SOAP message is an ordinary XML document. • The XML document contains the following XML elements: • A SOAP envelope, that defines the content of the message • A SOAP header (optional), that contains header information such as credentials • A SOAP body, that contains request and response information JA-SIG Workshop Series Syntax Rules • A SOAP message: • Must be encoded using XML • Must have a SOAP envelope • Can have a SOAP header • Must have a SOAP body • Must use the SOAP envelope namespaces • Must use the SOAP encoding namespace • Must NOT contain a DTD reference • Must NOT contain XML processing instructions JA-SIG Workshop Series SOAP Request Example <soap:Envelope> <soap:Body> <GetPrice> <Item>Apples</Item> </GetPrice> </soap:Body> </soap:Envelope> JA-SIG Workshop Series SOAP Template <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/“ soap:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/"> <soap:Header>…</soap:Header>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages51 Page
-
File Size-