More Related Content
Similar to Deawsj 7 ppt-2_c (20)
Deawsj 7 ppt-2_c
- 1. Collaborate
Knowledge Byte
In this section, you will learn about the following:
• Java API for XML Registries (JAXR)
• The wscompile Tool
• Web service security
• Quality of Service of Web services
©NIIT Collaborate Lesson 2C / Slide 1 of 18
- 2. Collaborate
Java API for XML Registries (JAXR)
• JAXR is an API that you can use in your Java application to access Web service
registries.
• You can use JAXR to publish Web services and also retrieve information of
other published Web services from the registry.
• Using JAXR, you can write registry clients that are portable across different
target registries.
• The JAXR API provides classes and interfaces that enable client applications to
interact with various XML-based registries.
• To provide a standard registry service, XML-based registries need to conform
to registry standards, such as ebXML and UDDI.
©NIIT Collaborate Lesson 2C / Slide 2 of 18
- 3. Collaborate
Java API for XML Registries (JAXR)
(Contd.)
• The structure of information stored in the UDDI and ebXML registries is
different.
• As a result, an application written for UDDI registry cannot be used with ebXML
registry.
• Similarly, an application written for ebXML registry cannot be used with UDDI
registry.
• The JAXR API provides a common interface that allows Java programs to
interact with both the registries.
©NIIT Collaborate Lesson 2C / Slide 3 of 18
- 4. Collaborate
Java API for XML Registries (JAXR)
(Contd.)
• The following table lists the two packages of JAXR API:
Package Description
Consists of interfaces that define object
javax.xml.registry.infomodel types that a registry contains and how the
object relates to each other. The base
interface in this package is the
RegistryObject interface that provides
minimal metadata for registry objects. The
sub interfaces of the RegistryObject
interface are Organization, Service,
and ServiceBinding.
©NIIT Collaborate Lesson 2C / Slide 4 of 18
- 5. Collaborate
Java API for XML Registries (JAXR)
(Contd.)
• The following table lists the two packages of JAXR API (Contd.):
Package Description
javax.xml.registry Consists of interfaces and a
ConnectionFactory class that allows JAXR
clients to connect to a registry in order to
search Web service information stored in the
registry. JAXR clients can also use the
javax.xml.registry package to publish
information of Web services.
©NIIT Collaborate Lesson 2C / Slide 5 of 18
- 6. Collaborate
The wscompile Tool
• The wscompile tool is a command line tool that J2EE Application Server
provides to generate the WSDL file of a Web service.
• The wscompile tool also generates various helper classes, such as stubs,
skeletons, and serializers that a Web service client uses to access a Web
service.
• The syntax to use wscompile tool is:
wscompile <options> <configuration-file>
• In the preceding code snippet, configuration-file refers to the XML file that
contains information as how the wscompile generates the WSDL file.
• The wscompile tool also uses the configuration file to generate runtime
classes of the Web service.
©NIIT Collaborate Lesson 2C / Slide 6 of 18
- 7. Collaborate
The wscompile Tool (Contd.)
• Following listing shows the various options of wscompile tool:
• -classpath <path>: Specifies the path to directories and files that needs
to be in the classpath for running the tool.
• -d <directory name>: Specifies the directory name in which the tool
needs to store generated files.
• -gen:client: Specifies that the tool needs to generate client-side helper
classes, such as stubs.
• -gen:server: Specifies that the tool needs to generate server-side
helper classes, such as skeletons and the WSDL file.
• -gen:both: Specifies that the tool needs to create both client-side and
server-side classes.
©NIIT Collaborate Lesson 2C / Slide 7 of 18
- 8. Collaborate
The wscompile Tool (Contd.)
• Following listing shows the various options of wscompile tool (Contd.):
• -g: Specifies that the tool needs to provide debugging information.
• -s <directory>: Specifies the directory in which the tool needs to store
source files.
• verbose: Specifies that the tool needs to output messages of its
activities.
• -version: Specifies that the tool needs to output its version information.
©NIIT Collaborate Lesson 2C / Slide 8 of 18
- 9. Collaborate
Web Services Security
• Web services security can be classified into:
• Transport-Layer Security
• Message-Layer Security
©NIIT Collaborate Lesson 2C / Slide 9 of 18
- 10. Collaborate
Web Services Security (Contd.)
• Transport-Layer Security
• Web services at transport layer are made secure using the Secure
Socket Layer (SSL).
• SSL/TLS provides several security features such as authentication,
confidentiality, and data security.
©NIIT Collaborate Lesson 2C / Slide 10 of 18
- 11. Collaborate
Web Services Security (Contd.)
• Message-Layer Security
• The message layer security provides security between the end points
that sends and receives messages.
• When a transaction takes more than one step to complete, the XML
message is routed through many Web servers to complete a
transaction.
• In such a scenario, the message can be encrypted so that a particular
receiver receives it.
• When the message travels through intermediate layers before being
received by intended receiver, the message remains secure from
tampering at any layer.
©NIIT Collaborate Lesson 2C / Slide 11 of 18
- 12. Collaborate
Quality of Service (QOS) of Web
Services
• With the growing competition in the Web services race, QoS of Web services
is a critical issue.
• QOS needs to be provided by service providers to remove existing
bottlenecks present in Web services.
• QOS allows Web services to implement a faster, secure, and reliable
mechanism to service clients.
©NIIT Collaborate Lesson 2C / Slide 12 of 18
- 13. Collaborate
Quality of Service (QOS) of Web
Services (Contd.)
• QOS of a Web service depends on:
• Performance: Refers to processing and latency time of a Web service.
• Reliability: Refers to the ability of a Web service to maintain its QOS
• Integrity: Refers to the ability of a Web service to ensure that Web
service data and transactions are securely transported and performed,
respectively.
• Accessibility: Refers to the ability of a Web service to remain easily
accessible with the increase in the size of client volume.
• Availability: Refers to the time within a particular time span a Web
service is ready and running to service client requests.
• Interoperability: Refers to the ability of the Web service to interact with
clients and other Web services that are developed using different
programming languages.
©NIIT Collaborate Lesson 2C / Slide 13 of 18
- 14. Collaborate
From the Expert’s Desk
This section will introduce the following:
• FAQs on Web service protocol stack
• FAQs on finding public registries.
©NIIT Collaborate Lesson 2C / Slide 14 of 18
- 15. Collaborate
FAQs
• What is a Web service protocol stack?
• Web service protocol stack
• Is a collection of protocols that are used to describe a Web service.
• Consists of four layers:
• Service Transport Layer: Transports message between Web
services and Web service clients.
• Service Description Layer: Describes a Web service using a
public interface.
• Service Discovery Layer: Provides functionalities, such as finding
and publishing a Web service.
• XML Messaging Layer: Encodes messages in XML format so that
messages are readable at both the ends.
©NIIT Collaborate Lesson 2C / Slide 15 of 18
- 16. Collaborate
FAQs (Contd.)
• Where can I find public registries to query and publish Web services?
• You can also use the Registry Server that comes packaged with the Java
Web Service Developer Pack (JWSDP) to publish your Web service.
• Registry Server is an implementation of the UDDI version 2 registry and
acts as a test registry for Web services development.
• Some URLs of publicly available registries are:
• http://uddi.ibm.com/testregistry/inquiryapi: URL for the query
service of IBM UDDI registry.
• https://uddi.ibm.com/testregistry/publishapi: URL for the publish
service of IBM UDDI registry.
• http://uddi.microsoft.com/inquire: URL for the query service of
Microsoft UDDI registry.
• https://uddi.microsoft.com/publish: URL for the publish service of
Microsoft UDDI registry.
©NIIT Collaborate Lesson 2C / Slide 16 of 18
- 17. Collaborate
Challenge
• A JAX-RPC Web service end point interface needs to extend the
___________ interface.
• Select the correct option that shows the command to generate client
side classes using the wscompile tool:
• wscompile –gen:server –d build
• wscompile -gen:client -d build config.xml
• wscompile –client config.xml
• wscompile config.xml –d build –gen:client
3. The__________interface of the JAXR API represents a connection
between the JAXR client and provider.
4. Which layer of the Web service protocol stack describes a Web service
using a public interface?
©NIIT Collaborate Lesson 2C / Slide 17 of 18
- 18. Collaborate
Solution
• java.rmi.remote
• b. wscompile –gen:client –d build config.xml
• Connection
• Service description layer
©NIIT Collaborate Lesson 2C / Slide 18 of 18