Professional Documents
Culture Documents
Introduction
XML
XML Namespaces
Agenda
XML Schema
JAX-WS
SOA
Company A
Company B
Web Service
3. interact
Other tiers
Other tiers
2. Find
Service descriptions
SOAP
(Simple Object Access Protocol)
XML
(Extensible Markup Language)
WSDL
(Web Service Definition Language)
XSD
(XML Schema Definition)
SEI
(Service Endpoint Interface)
SOA
(Service Oriented Architecture)
IBM Confidential
XML
XML stands for EXtensible Markup Language.
XML was designed to describe data.
XML is a software and hardware independent tool for carrying information.
Developers can create their own data definitions and models of representation
XML Namespaces
Similar to Java packages:
Are used to avoid name collision;
Facilitate grouping of elements;
<html:table
xmlns:html="http://www.w3.org/TR/html
4/">
<html:tr>
<html:td>Bruxelles</html:td>
<html:td>Frankfurt am Main/html:td>
</html:tr>
</html:table>
<jobs:table
xmlns:jobs="http://www.ibm.com/erpb">
<jobs:name>Java Developer</jobs:name>
<jobs:years>Network admin</jobs:years>
</jobs:table>
<employee id="13512512">
<name>John Doe</name>
<phone>0720654321</phone>
<phone>0720123456</phone>
<cnp>1210186410071</cnp>
<birthDate>1986-10-21</birthDate>
<address>
<city>Bucuresti</city>
<street>Viorele</street>
<streetNumber>4</streetNumber>
</address>
</employee>
XML Schema
<employee id="13512512">
<name>John Doe</name>
<phone>0720654321</phone>
<schema
<phone>0720123456</phone>
xmlns="http://www.w3.org/2001/XMLSchema"
<cnp>1210186410071</cnp>
TargetNamespace="..."
<birthDate>1986-10-21</birthDate>
xmlns:xs="http://www.w3.org/2001/XMLSchema"
<address>
xmlns:tns="http://www.example.org/employee"
<city>Bucuresti</city>
xmlns:a="http://www.example.org/address">
<street>Viorele</street>
<element name="employee" type="tns:Employee"/> <streetNumber>4</streetNumber>
</address>
</employee>
<complexType name="Employee">
<sequence>
<element name="name" type="xs:string"/>
<element name="phone" maxOccurs="10" type="xs:string"/>
<element name="birthDate" type="xs:date"/>
<element name="cnp" type="xs:long"/>
<element name="address" type="a:Address"/>
</sequence>
</complexType>
DEMO!
...
</schema>
13
IBM Confidential
Name
parameters
return type(s)
JAX-WS
The Java API for XML-based Web services (JSR-224), commonly abbreviated
JAX-WS, is the next generation Web services programming model.
It replaces the earlier JAX-RPC technology.
JAX-WS defines a model that uses Java annotations to develop Web service
providers and Web service clients
Java EE 5 platform requires compatible application servers to support JAX-WS
2.0, WebSphere Application Server V7 has already taken the next step and
supports JAX-WS 2.1
DEMO!
JAX-WS (2)
JAX-WS, like all specifications, is divided into 2 parts
The First part consists of an API provided by SUN.
This API is accompanied by a JSR.
The API consists of a set of interfaces, annotations, xml files and abstract
classes (sometimes maybe a few base classes) which are to be used when
using that feature.
One very important thing about this API that should be noted is that the API in
itself is not capable of achieving the intended objective of the specification.
The JSR lays down a set of rules and regulations governing the API.
The Second part of any specification is the implementation.
The implementation follows all the rules laid down by the JSR and uses the API
(i.e. provides all implementation for interfaces, and classes that use the
annotations to get the desired objective) to provide a base.
Multiple reference implementations by different vendors like: Sun (JDK 1.6),
Apache (CXF, AXIS 2), IBM (Web sphere), ORACLE (Weblogic App Server),
Glassfish (Metro).
DEMO!
What is WSDL?
WSDL stands for Web Services Description Language.
A WSDL file is an XML document that describes a Web
service.It specifies the location of the service and the
operations (or methods) the service exposes.
youre able to apply more restrictions and rules here that you otherwise
needed to implement in some method in your concrete programming
language
If the server and the client part are implemented by different teams, both
sides are able to begin implementing quickly
DEMO!
LogicalHandlers with provide access to the SOAP body's content (the payload)
only. For logical handlers, JAXB or one of the Source options is used to
modify the message instead of the protocol-specific SAAJ.
Handlers carry a MessageContext - a thread safe mechanism holding
request/response data between the handlers of a chain, and between the client
or service endpoints and the handlers
DEMO!
Service-Oriented Architecture
A service-oriented architecture (SOA) is an architectural pattern in computer
software design in which application components provide services to other
components via a communications protocol, typically over a network.
Weaknesses
Opportunities
Threats
27
Links
Web Services Description Language (WSDL) 1.1
http://www.w3.org/TR/wsdl
SOAP 1.2 specifications
http://www.w3.org/TR/soap/
JAXB 2.0 specifications
http://jcp.org/aboutJava/communityprocess/mrel/jsr222/index.html
JAX-RPC
http://jcp.org/en/jsr/detail?id=101
JAX-WS 2.0
http://jcp.org/en/jsr/detail?id=224
Web services metadata
http://jcp.org/en/jsr/detail?id=181
JAX-RS
http://jcp.org/en/jsr/detail?id=311
28
Links (2)
Questions?
30