T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander
Contents n Short review of XML & related specs n Web Services u Driving forces u Architecture & protocol stack n WSDL 1.1 u WSDL document elements u Mapping SOAP to WSDL n WSDL 2.0 n Implementations n Summary
XML n XML (eXtensible Markup Language) is a framework for defining markup languages n Standardized by W3C n Idea: to separate syntax from semantics, custom markup, internationalization, platform independence n XML Document: prolog, elements, attributes, entity references, comments n Validated using DTD or schema n Two things: well-formedness and validity
Related standards n Namespaces u Modular document definition, multiple inheritance, collision avoidance n XPath / XQuery u Navigation and query of parts of the document n XML linking language (Xlink) u Associations between multiple resources u Rules for traversal n XML Schema u definition of document structure and custom data types n XSLT u Extensible Stylesheet Language Transformation u Transformation of documents
Namespaces n Many documents can have identical elements that denote different things u Namespaces are the XML way to classify elements u A qualified name is a name subject to namespace interpretation n W3C Recommendation n In general, a namespace is just a tag u An arbitrary string u Defined to be a URI u Case-sensitive n A common practice to store a schema / WSDL into the place referenced by the URI u Semantics depends on the specific platform u Some XML validators use these
Example namespace <!-- the "edi" prefix is bound to for the "x" element and contents --> <!-- the 'taxClass' attribute's namespace is --> Baby food
About Schemas n XML language for describing and constraining the content of XML documents n A W3C Recommendation n Used to specify u The allowed structure of an XML document u The allowed data types contained in XML documents n XML Schema documents are XML documents n Schema document: schema element and element, attribute, and type definitions + annotations
Driving forces I n Universal data access / representation u Independent of OS, programming language, network protocol, … n Move from human-centric to application- centric web u Applications converse with each other and use machine-related information published on the web u Application-areas: package tracking, card verification, shopping bots, single sign-on, calendar, ,... u Presentation layer for the Internet?
Driving forces II n Making Web a programming interface u We have had servlets, CGI, CORBA for years u Idea is to standardise languages and protocols to have better integration n Make service composition possible u Faster project throughput u Better utilization of global resources u Cope with heterogeneity n Deferred binding u Discovery / broker, interpret, compose, execute u Many levels of deference
A Basic Web Service Computer A Language: C++ OS: W2000 Computer A Language: C++ OS: W2000 Computer B Language: Java OS: Linux Computer B Language: Java OS: Linux XML Independent of language, OS, network protocols
Additional properties n A web service should be self-describing u Interface is published with the implementation u Minimum interface is human readable description u The interface can also be written in a common XML grammar (WSDL) n A web-service should be discoverable u The web service is published u It has a life cycle u Interested parties can find it n Not mandatory but desirable properties
Standardization n W3C Web Services Activity u XML Protocol Working Group F SOAP u Web Services Addressing Working Group u Web Services Choreography Working Group u Web Services Description Working Group F WSDL n OASIS u E-business standards u UDDI (Universal Description, Discovery and Integration) n WS-I (Web Service Interoperability Org.) u Binding profiles,..
Web Service Architecture n The three major roles in web services u Service provider F Provider of the WS u Service Requestor F Any consumer / client u Service Registry F logically centralized directory of services n A protocol stack is needed to support these roles
XML Messaging n Several alternatives for XML messaging u XML Remote Procedure calls (XML-RPC) u SOAP u Regular XML transported over HTTP XML-RPCSOAP HTTP POST/GET
SOAP Version 1.2 n The definition of the XML-based information for exchanging structured and typed information between peers n A SOAP message is formally specified as an XML Infoset n Infosets can have different on-the-wire representations, one common example of which is as an XML 1.0 document. n A stateless, one-way message exchange paradigm n Applications can create more complex interaction patterns u request/response, request/multiple responses
Web Services Protocol Stack n Message Exchange u Responsible for transporting messages u HTTP, BEEP n XML Messaging u Responsible for encoding messages in common XML format u XML-RPC, SOAP n Service Description u Responsible for describing an interface to a specific web service u WSDL n Service discovery u Responsible for service discovery and search u UDDI
WS Protocol Stack Transport: HTTP, FTP, BEEP, SMTP, JMS XML Messaging: SOAP, XML-RPC, XML Description: WSDL Discovery: UDDI
Main components today n XML data representation u XML Schema Definitions (xsd) for types u XML Namespaces for unambiguity n SOAP u Basic transport (XML messaging) u Sync / async communication and RPC n WSDL u Description of (SOAP) services n UDDI u Service registry
Example WS layering Transport: HTTP(S), SMTP, JMS,.. XML processor SOAP processor Serialization / deserialization (java to XML mapping) Service container J2EE integration Management services:Admin, UDDI, depl., auditing
How it could work n 1. A standard body creates a WSDL interface definition n 2. A service programmer implements a service according to the WSDL definition n 3. A client programmer implements a client according to the WSDL definition n 4. A service provider deploys the service and publishes a WSDL implementation definition, and registers it into UDDI n 5. A client program pulls WSDL from UDDI, checks conformance, and uses SOAP for access
2. Creating server application n Pull WSDL definition from somewhere (UDDI) u Only use high-level WSDL, no bindings yet n Generate platform specific skeleton code using automated tools n Write the actual program code
3. Creating client application n Pull WSDL definition from somewhere (UDDI) u Use only high-level WSDL, no bindings yet n Generate platform specific stub code using automated tools n Write the actual program code
4. Deploying the service UDDI WSDL document WSDL document WSDL portType WSDL portType WSDL binding WSDL binding WS service SOAP proc. Transport
5. Using a service UDDI WSDL portType WSDL portType WSDL binding WSDL binding WS service SOAP proc. Transport WSDL document WSDL document
About invocation mechanisms n WS does not define an invocation mechanism n Alternatives u Microsoft.NET framework u Java-based framework F JAVA API for WSDL (JWSDL) F JAX-RPC F Java API for XML registries (JAXR) F Apache Axis F...