➤The main difference between a web service and a web application is, that a web application is typically intended for human-to-computer interaction, whereas web services are typically intended for computer-to-computer interaction.
➧Web services are server-side application components, which provides a set of services
•The services of the web service are exposed via an API
•Loosely coupled architecture, and interacts with client-side components via the API
•Multiple types of clients can communicate with the web-service via the API
Discuss what WSDL is and the use of it in the context of web services
•WSDL is an XML vocabulary for describing Web services allowing developers to describe Web Services and their capabilities, in a standard manner.
•standard format to describe a Web Service
•The document written in WSDL is also simple called WSDL (or WSDL document)
•WSDL is a contract between the XML(SOAP) Web service and the client who wishes to use this service
•The service provides the WSDL document and the Web service client uses the WSDL document to create the stub (or to dynamically decode messages)
Usage of WSDL
➤WSDL is often used in combination with SOAP and XML Schema to provide web services over the Internet. A client program connecting to a web service can read the WSDL to determine what functions are available on the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema.
Explain the fundamental properties of a WSDL document
specifies three fundamental properties:
➺What a service does -operations (methods) provided by the service
➺How a service is accessed -data format and protocol details
➺Where a service is located -Address (URL) details
Use of WSDL document in web services and client development
➥WSDL is often used in combination with SOAP and an XML Schema to provide Web services over the Internet. A client program connecting to a Web service can read the WSDL file to determine what operations are available on the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema.
Discuss the structure of the WSDL document
WSDL Document Elements. A WSDL document has a definitions element that contains the other five elements, types, message, portType, binding and service. The following sections describe the features of the generated client code. WSDL supports the XML Schemas specification (XSD) as its type system.
explaining the elements in WSDL
- Types, which provides data type definitions used to describe the messages exchanged.
- message, which represents an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system.
- portType, which is a set of abstract operations. Each operation refers to an input message and output messages.
- binding, which specifies concrete protocol and data format specifications for the operations and messages defined by a particular portType.
- port, which specifies an address for a binding, thus defining a single communication endpoint.
- service, which is used to aggregate a set of related ports.
Compare the PortType and operation elements in WSDL with the java equivalences
portType (Analogs to Java interface)
- PortType is an abstraction part of WSDL.
- An abstract set of operations supported by one or more endpoints.
PortType defines the abstract interface of a web service.
➤A single Web service can support a number of different protocols. The structure of the data depends on the protocol that you use to invoke the Web service. Because of this, you need a way to map from the operations to the endpoints from which they can be accessed. The portType element takes care of this mapping.
➤You can place a portType definition for each of the protocols available to you for this Web service. For instance, you can have individual portType definitions for using SOAP, HTTP-POST, and HTTP-GET. The operation name is the method available from the Web service.
Compare and contrast the binding and service elements in WSDL
binding
- Binding is an concrete part of WSDL.
- Describes how the operation is invoked by specifying concrete protocol and data format specifications for the operations and messages.
- bindings are three types
- SOAP Binding
- HTTP GET & POST binding
- MIME binding
➤binding mechanism is used to attach a specific protocol or data format or structure to an abstract message, operation, or endpoint.
Explain how SOAP is used with HTTP
•SOAP supports both functional oriented and message oriented communication
•SOAP messages are carried as the payload of some other network protocol, for example via HTTP or SMTP (Simple Mail Transfer Protocol) or FTP (File Transfer Protocol) or TCP/IP (Transmission Control Protocol/Internet Protocol)
•Web services use SOAP as the logical transport mechanism for moving messages between services described by WSDL interfaces
Discuss how SOAP can be used for functional oriented communication
SOAP is known as the Simple Object Access Protocol, but in later times was just shortened to SOAP v1.2. SOAP is a protocol or in other words is a definition of how web services talk to each other or talk to client applications that invoke them.
Explain the structure of SOAP message in message oriented communication, indicating the elements used
SIMPLE OBJECT ACCESS PROTOCOL
SOAP supports both functional oriented and message oriented communication
•SOAP messages
•consistent envelope -header and body
•consistent data encoding -based on XML Schema type system
•protocol binding framework
•Envelope
•wraps entire message and contains header and body •defines an overall framework for expressing what is in a message; who should deal with it, and whether it is optional or mandatory
•Header
•optional element with additional info such as security or routing
•Body
•application-specific message content being communicated as arbitrary XML payloads in the request and response messages
•fault element provides information about errors that occurred while processing the message
Discuss the importance of the SOAP attachments, explaining the MIME header
The Attachment Feature defines a set of properties described in Property definition for the Attachment Feature Property Name Property Description SOAP Message An abstract structure that represents the primary SOAP message part of the compound SOAP structure. Secondary Part Bag An abstract structure that represents the compound SOAP structure's secondary part(s). This structure is a bag that contains representations of each of the compound SOAP structure's secondary part(s).
➤SOAP messages may have one or more attachments
•each AttachmentPart object has a MIME header to indicate the type of data it contains.
•it may also have additional MIME headers to identify it or to give its location, which can be useful when there are multiple attachments
•when a SOAP message has one or more AttachmentPart objects, its SOAPPart object may or may not contain message content
Identify different set of frameworks/librarie
We can create SOAP web services using JAX-WS
API, however some of the other frameworks that can be used are Apache Axis and
Apache CXF. Note that they are not implementations of JAX-WS API, they are
totally different framework that work on Servlet model to expose your business
logic classes as SOAP web services.
➧Describes the supported JAX-WS annotations and their associated properties. The @Action annotation specifies the WS-Addressing action that is associated with a web service operation.
JAX-WS
This
JAX-WS annotation can be used in 2 ways. If we are annotating this over a
class, it means that we are trying to mark the class as the implementing the
Web Service, in other words Service Implementation Bean (SIB). Or we are
marking this over an interface, it means that we are defining a Web Service
Interface (SEI), in other words Service Endpoint Interface.
Some of the important
annotations used in JAX-WS API are:
·
@WebService-
This JAX-WS annotation can be used in 2 ways. If we are annotating this over a class, it means that we are trying to mark the class as the implementing the Web Service, in other words Service Implementation Bean (SIB). Or we are marking this over an interface, it means that we are defining a Web Service Interface (SEI), in other words Service Endpoint Interface.
·
@SOAPBinding -
Demonstration of
@SOAPBinding JAX-WS annotation has already been shown in first program in 1.1. This annotation is used to specify the SOAP messaging style which can either be RPC or DOCUMENT. This style represents the encoding style of message sent to and fro while using the web service.
·
@WebMethod
JAX-WS
is bundled with JDK 1.6, which makes Java web service development easier to
develop.
Discuss how a web service can be tested using different approaches (using a dummy client or a dedicated tool, etc…)
This new way of software
development brings out new issues for Web Service testing to ensure the quality
of service that are published, bound, invoked and integrated at runtime.
Testing services and service-centric systems poses new challenges to traditional
testing approaches. Several Web Services testing approaches were developed to
address these new challenges.










No comments:
Post a Comment