1. Compare and contrast web applications with web services, indicating the need for web
services.
web applications
Web applications are defined by being interactive. You're supposed to use a web application in order to perform a function and use some of the web applications features. Lots of web applications don't even have real informative content or data exactly. People are just supposed to use them in order to perform additional tasks, using their features to accomplish something. You use a web application to check your incoming messages, for instance, or play a game.

web services
Web service is a technology by which two or more remote web applications interact with each other over network/internet. It can be implemented using Java, .net, PHP etc. Web pages allow people to communicate and collaborate with each other while web services allow programs to communicate and collaborate with each other.
2. Discuss what WSDL is and the use of it in the context of web services.
WSDL is an XML-based standard for describing a web service. A WSDL document describes the available functions of a web service, their expected arguments, and the data types for their return values. WSDLs are used by developers of client applications that consume XML-based web services.

3. Explain the fundamental properties of a WSDL document and the use of WSDL document in web services and client development.
web services and client
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 X
4. Discuss the structure of the WSDL document , explaining the elements in WSDL.
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.

5. Compare the PortType and operation elements in WSDL with the java equivalences.
PortType
The WSDL portType element defines a group of operations (sometimes known as an interface). The WSDL binding element describes the concrete details of using a particular portType with a given protocol. An abstract set of operations supported by one or more endpoints.


operation elements
WSDL Document Structure. Services are defined using six major elements: ... 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.
6. Compare and contrast the binding and service elements in WSDL.
Binding
WSDL Binding to SOAP. WSDL bindings defines the message format and protocol details for a web service. The binding element has two attributes - name and type. ... The soap:binding element has two attributes - style and transport.
Service elements
<types>
Defines the (XML Schema) data types used by the web service
<message>
Defines the data elements for each operation
<portType>
Describes the operations that can be performed and the messages involved.
<binding>
Defines the protocol and data format for each port type
7. Explain how SOAP is used with HTTP.
SOAP’s messages are defined at a high level in XML, but most SOAP applications use Web Services Definition Language (WSDL), which is authored in XML. The XML structure of SOAP makes it handy for applications that expect their information to be provided in XML form, and the fact that SOAP can ride on a variety of network protocols, including HTTP, means it’s easily passed through firewalls, where other protocols might require special accommodation.
8.Discuss how SOAP can be used for functional oriented communication?
SOAP ( Simple Object Access Protocol) is a message protocol that allows distributed elements of an application to communicate. SOAP can be carried over a variety of lower-level protocols, including the web-related Hypertext Transfer Protocol . SOAP defines a header structure that identifies the actions that various SOAP nodes are expected to take on the message, in addition to a payload structure for carrying information. The concept of routing a message through a string of nodes that perform different functions is how SOAP supports things like addressing, security and format-independence. Essentially, the headers identify roles, which in turn provide the SOA features which SOAP then routes to. Stringing messages through a sequence of steps is uncommon in today’s micro service-centric development environments.
9. Explain the structure of SOAP message in message oriented communication, indicating the elements used.
SOAP is intended to be a simple yet powerful extensible protocol for distributed messaging based on XML. A key element of SOAP is its concept of having a message envelope and a set of headers. The envelope contains the message body that can be XML data or parameters and is intended for the recipient.
In this example, a Get Last Trade Price SOAP request is sent to a Stock Quote service. The request takes a string parameter, ticker symbol, and returns a float in the SOAP response. The SOAP Envelope element is the top element of the XML document representing the SOAP message. XML namespaces are used to disambiguate SOAP identifiers from application specific identifiers.
Example 1 SOAP Message Embedded in HTTP Request
10. Discuss the importance of the SOAP attachments, explaining the MIME header.
This document defines a SOAP feature that represents an abstract model for SOAP attachments. It provides the basis for the creation of SOAP bindings that transmit such attachments along with a SOAP envelope, and provides for reference of those attachments from the envelope.

11. Identify different set of frameworks /libraries for SOAP web service development, in different environments (Java, .Net, PHP, etc…).
Java
WS-Reliable Messaging, WS-Security, WS- Atomic Transaction, WS-Addressing, MTOM, WS-Policy, WS-Metadata Exchange
.Net
WS-Addressing, WS-Metadata Exchange, WS-Security, WS-Policy, WS-Security Policy, WS-Trust, WS-Secure Conversation, WS-Reliable Messaging, WS-Coordination, WS-Atomic Transaction,WS-Discovery
PHP
SOAP MTOM, WS-Addressing, WS-Security, WS-Security Policy, WS-Secure Conversation, WS-Reliable Messaging
C and C++
WS-Addressing, WS-Discovery, WS-Policy, WS-Reliable Messaging, WS-Security, WS-Security Policy.
12. Explain the annotations in JAX-WS, providing examples of their use.
13. Discuss how a web service can be tested using different approaches (using a dummy client
or a dedicated tool, etc…).
JAX-WS uses the javax.jws package
•It uses annotations
@WebService
@WebMethod
@OneWay
web applications
Web applications are defined by being interactive. You're supposed to use a web application in order to perform a function and use some of the web applications features. Lots of web applications don't even have real informative content or data exactly. People are just supposed to use them in order to perform additional tasks, using their features to accomplish something. You use a web application to check your incoming messages, for instance, or play a game.

web services
Web service is a technology by which two or more remote web applications interact with each other over network/internet. It can be implemented using Java, .net, PHP etc. Web pages allow people to communicate and collaborate with each other while web services allow programs to communicate and collaborate with each other.
2. Discuss what WSDL is and the use of it in the context of web services.
WSDL is an XML-based standard for describing a web service. A WSDL document describes the available functions of a web service, their expected arguments, and the data types for their return values. WSDLs are used by developers of client applications that consume XML-based web services.

3. Explain the fundamental properties of a WSDL document and the use of WSDL document in web services and client development.
web services and client
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 X
4. Discuss the structure of the WSDL document , explaining the elements in WSDL.
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.

5. Compare the PortType and operation elements in WSDL with the java equivalences.
PortType



operation elements
WSDL Document Structure. Services are defined using six major elements: ... 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.
6. Compare and contrast the binding and service elements in WSDL.
Binding

Service elements
<types>
Defines the (XML Schema) data types used by the web service
<message>
Defines the data elements for each operation
<portType>
Describes the operations that can be performed and the messages involved.
<binding>
Defines the protocol and data format for each port type
7. Explain how SOAP is used with HTTP.
SOAP is an integral part of the service-oriented architecture and the Web services specifications associated with SOA. Because it allows the sender to create a message route based on the logical services that have to be applied to the message on the way to its destination, it lends itself to providing secure and compliant connections, controlling access, offering reliable delivery and failure recovery, and supporting dynamic service discovery. SOA without SOAP is difficult to imagine.

The data structure of SOAP is based on XML, which is similar in many ways to the HTML used to define web pages. Like HTML, XML is largely human-readable, which makes it fairly easy to understand a SOAP message, but also makes the messages relatively large in comparison to the Common Object Request Broker Architecture and its Remote Procedure Call protocol that will accommodate binary data.

SOAP ( Simple Object Access Protocol) is a message protocol that allows distributed elements of an application to communicate. SOAP can be carried over a variety of lower-level protocols, including the web-related Hypertext Transfer Protocol . SOAP defines a header structure that identifies the actions that various SOAP nodes are expected to take on the message, in addition to a payload structure for carrying information. The concept of routing a message through a string of nodes that perform different functions is how SOAP supports things like addressing, security and format-independence. Essentially, the headers identify roles, which in turn provide the SOA features which SOAP then routes to. Stringing messages through a sequence of steps is uncommon in today’s micro service-centric development environments.
9. Explain the structure of SOAP message in message oriented communication, indicating the elements used.
SOAP is intended to be a simple yet powerful extensible protocol for distributed messaging based on XML. A key element of SOAP is its concept of having a message envelope and a set of headers. The envelope contains the message body that can be XML data or parameters and is intended for the recipient.
In this example, a Get Last Trade Price SOAP request is sent to a Stock Quote service. The request takes a string parameter, ticker symbol, and returns a float in the SOAP response. The SOAP Envelope element is the top element of the XML document representing the SOAP message. XML namespaces are used to disambiguate SOAP identifiers from application specific identifiers.
Example 1 SOAP Message Embedded in HTTP Request
10. Discuss the importance of the SOAP attachments, explaining the MIME header.
This document defines a SOAP feature that represents an abstract model for SOAP attachments. It provides the basis for the creation of SOAP bindings that transmit such attachments along with a SOAP envelope, and provides for reference of those attachments from the envelope.

11. Identify different set of frameworks /libraries for SOAP web service development, in different environments (Java, .Net, PHP, etc…).
Java
WS-Reliable Messaging, WS-Security, WS- Atomic Transaction, WS-Addressing, MTOM, WS-Policy, WS-Metadata Exchange
.Net
WS-Addressing, WS-Metadata Exchange, WS-Security, WS-Policy, WS-Security Policy, WS-Trust, WS-Secure Conversation, WS-Reliable Messaging, WS-Coordination, WS-Atomic Transaction,WS-Discovery
PHP
SOAP MTOM, WS-Addressing, WS-Security, WS-Security Policy, WS-Secure Conversation, WS-Reliable Messaging
C and C++
WS-Addressing, WS-Discovery, WS-Policy, WS-Reliable Messaging, WS-Security, WS-Security Policy.
12. Explain the annotations in JAX-WS, providing examples of their use.
The starting point for developing a JAX-WS web service is a Java class annotated with the
javax.jws.WebService
annotation. The Web Service
annotation defines the class as a web service endpoint.
A service endpoint interface is a Java interface that declares the methods that a client can invoke on the service. An SEI is not required when building a JAX-WS endpoint. The web service implementation class implicitly defines a SEI.
You may specify an explicit SEI by adding the
endpoint Interface
element to the WebService
annotation in the implementation class. You must then provide a SEI that defines the public methods made available in the endpoint implementation class.
You use the endpoint implementation class and the
wsgen
tool to generate the web service artifacts and the stubs that connect a web service client to the JAX-WS run time. For reference documentation on wsgen
, see the Application Server man pages at .
Together, the
wsgen
tool and the Application Server provide the Application Server's implementation of JAX-WS.
These are the basic steps for creating the web service and client:
- Code the implementation class.
- Compile the implementation class.
- Deploy the WAR file. The tie classes (which are used to communicate with clients) are generated by the Application Server during deployment.
- Code the client class.
- Use
ws import
to generate and compile the stub files. - Compile the client class.
- Run the client.
The sections that follow cover these steps in greater detail.
JAX-WS Example
Now that we have gone through the web services terminologies, let’s go ahead and create a JAX-WS web service. We will create a web service that will expose methods to add, delete and get person objects. So first of all we will create a model bean for our data.
JAX-WS uses the javax.jws package
•It uses annotations
@WebService
Web Service Example
@WebMethod
JAX-WS annotation can be applied over a method only. This specified that the method represents a web service operation
@OneWay
JAX-WS annotation is applied to WebMethod which means that method will have only input and no output. When a method is called, control is returned to calling method even before the actual operation is performed. It means that nothing will escape method neither response neither exception.
No comments:
Post a Comment