The document provides an overview of web service testing. It defines what a web service is and how they are used. It discusses WSDL and how it is used to describe web services. SOAP and REST are introduced as protocols for communicating with web services. PUTTY and RESTClient plugins are presented as tools for testing web services using terminals and sending requests. Examples are given for SOAP requests and responses as well as for testing web service content, error logs, and functionality.
It will describes SOAP/REST differences and SOAP web services in detail with practical approach. it shows usage of SOAP, XML, JAVA, WSDL, XSD and RPC with examples.
JAX-WS is the replacement and next generation to JAX-RPC and makes web services development much easier using annotations and much less configuration. JAX-WS is useful for people building webservices/SOA based infrastructure as JAX-WS makes the web service development much easier and is a big gain for developer productivity.
The session uses a web service for temperature conversion example to build both the client side and Server side artifacts. Also on the server side both Servlet based and EJB3.0 based web service development will be demonstrated. JAXB concepts will be used to demonstrate the examples.
The session uses Eclipse Ganymede and Jboss 5.0. However JAX-WS being the standard, the code will smoothly work on any JavaEE based compliant servers.
Web services soap and rest by mandakini for TechGigMandakini Kumari
WS serves as an interface to software developers.
Using WS as an API you can convert applications into web-applications.
WS is the vision of ‘Future Internet’
The basic Web services platform is XML + HTTP.
WS is future for Mobile application
It will describes SOAP/REST differences and SOAP web services in detail with practical approach. it shows usage of SOAP, XML, JAVA, WSDL, XSD and RPC with examples.
JAX-WS is the replacement and next generation to JAX-RPC and makes web services development much easier using annotations and much less configuration. JAX-WS is useful for people building webservices/SOA based infrastructure as JAX-WS makes the web service development much easier and is a big gain for developer productivity.
The session uses a web service for temperature conversion example to build both the client side and Server side artifacts. Also on the server side both Servlet based and EJB3.0 based web service development will be demonstrated. JAXB concepts will be used to demonstrate the examples.
The session uses Eclipse Ganymede and Jboss 5.0. However JAX-WS being the standard, the code will smoothly work on any JavaEE based compliant servers.
Web services soap and rest by mandakini for TechGigMandakini Kumari
WS serves as an interface to software developers.
Using WS as an API you can convert applications into web-applications.
WS is the vision of ‘Future Internet’
The basic Web services platform is XML + HTTP.
WS is future for Mobile application
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
In this talk, held as part of the Web Engineering lecture series 2015 at Vienna University of Technology, we give an overview of the current state of the art in the domain of Web Services.
In the first part we dwell on the main principles of Service Oriented Architectures (SOA), followed by an introduction of the three core standards SOAP, WSDL, as well as UDDI. Furthermore, we briefly cover the Java API for XML Web Services (JAX-WS).
In the second part we focus on principles of RESTful Web Services and the Java API for RESTful Web Services. The lecture is accompanied by practical examples, which are also available on GitHub.
Overview of JAX-WS technology for web services (Java API for XML Web Services).
JAX-WS is the core Java web service technology for Java EE applications.
It provides a unified client and server-side API for writing SOAP/WSDL based web services.
JAX-WS is platform independent. Many Java platforms like Glassfish, Axis2 or CXF support JAX-WS.
Thus services developed with JAX-WS on one platform can be easily ported to another platform.
JAX-WS is based on annotations like @WebService thus greatly simplifying the development of web services.
POJOs (Plain Old Java Objects) can be simply annotated with JAX-WS annotations thus turning these into web service implementations.
JAX-WS is the core web service technology according to JSR-224 affording basic web service functionality.
WSIT (Web Service Interoperability Technology) sits on top of JAX-WS and adds enhanced functionality like security, reliability and transactions.
WSIT is the standard Java WS protocol stack beyond basic WS functionality (SOAP, WSDL) to achieve interoperability between Java and .Net (for more complex applications that go beyond simple WS requests).
SOAP is a simple and flexible messaging framework for transferring information specified in the form of an XML infoset between an initial SOAP sender and ultimate SOAP receiver.
Overview of web services, SOAP, WSDL and UDDI.
A web service provides a defined set of functionality on a machine-processable interface.
The web service interface is described in a formal language like WSDL that allows creating code to access the service thus simplifying web service consumer (client) and provider (server) development.
In big web services, the interface is typically described in WSDL while the access to the service makes use of the SOAP message protocol.
SOAP has its roots in remote object access but is now a general message based and asynchronous transport mechanism.
SOAP is typically carried in HTTP (HyperText Transmission Protocol), but other message based protocols like SMTP (Email) or plain TCP could be used as well.
WSDL provides a formalized description of an interface that is coarsely separated in an abstract service interface definition containing operations and data types, a transport binding that describes how the web service is accessed and finally a description of the location (address) under which a web service is accessible.
UDDI (Universal Description and Discovery Protocol) was meant to become the standard protocol for some kind of a public yellow pages where publicly accessible web services would be listed. Lack of industry interest, however, prevented UDDI to gain widespread use.
The slides provide a major overview on SOAP protocol, and demonstrates a working example that uses SOAP for RPC. It uses WCF/visual studio and Apache Axis for the implementation.
Introduction to SOAP/WSDL Web Services and RESTful Web Servicesecosio GmbH
In this talk, held as part of the Web Engineering lecture series 2015 at Vienna University of Technology, we give an overview of the current state of the art in the domain of Web Services.
In the first part we dwell on the main principles of Service Oriented Architectures (SOA), followed by an introduction of the three core standards SOAP, WSDL, as well as UDDI. Furthermore, we briefly cover the Java API for XML Web Services (JAX-WS).
In the second part we focus on principles of RESTful Web Services and the Java API for RESTful Web Services. The lecture is accompanied by practical examples, which are also available on GitHub.
Overview of JAX-WS technology for web services (Java API for XML Web Services).
JAX-WS is the core Java web service technology for Java EE applications.
It provides a unified client and server-side API for writing SOAP/WSDL based web services.
JAX-WS is platform independent. Many Java platforms like Glassfish, Axis2 or CXF support JAX-WS.
Thus services developed with JAX-WS on one platform can be easily ported to another platform.
JAX-WS is based on annotations like @WebService thus greatly simplifying the development of web services.
POJOs (Plain Old Java Objects) can be simply annotated with JAX-WS annotations thus turning these into web service implementations.
JAX-WS is the core web service technology according to JSR-224 affording basic web service functionality.
WSIT (Web Service Interoperability Technology) sits on top of JAX-WS and adds enhanced functionality like security, reliability and transactions.
WSIT is the standard Java WS protocol stack beyond basic WS functionality (SOAP, WSDL) to achieve interoperability between Java and .Net (for more complex applications that go beyond simple WS requests).
SOAP is a simple and flexible messaging framework for transferring information specified in the form of an XML infoset between an initial SOAP sender and ultimate SOAP receiver.
Overview of web services, SOAP, WSDL and UDDI.
A web service provides a defined set of functionality on a machine-processable interface.
The web service interface is described in a formal language like WSDL that allows creating code to access the service thus simplifying web service consumer (client) and provider (server) development.
In big web services, the interface is typically described in WSDL while the access to the service makes use of the SOAP message protocol.
SOAP has its roots in remote object access but is now a general message based and asynchronous transport mechanism.
SOAP is typically carried in HTTP (HyperText Transmission Protocol), but other message based protocols like SMTP (Email) or plain TCP could be used as well.
WSDL provides a formalized description of an interface that is coarsely separated in an abstract service interface definition containing operations and data types, a transport binding that describes how the web service is accessed and finally a description of the location (address) under which a web service is accessible.
UDDI (Universal Description and Discovery Protocol) was meant to become the standard protocol for some kind of a public yellow pages where publicly accessible web services would be listed. Lack of industry interest, however, prevented UDDI to gain widespread use.
Enjoying the Move from WCF to the Web APIKevin Hazzard
A more advanced talk for those developers thinking of making the move from ASMX or WCF-based services to the ASP.NET Web API. RESTful services have their place in the middle tiers and this talk addresses how to make the mental shift toward REST. There's a lot of focus on how to ease the transition from such a complex framework as WCF to something as simplistic as the Web API.
1. WEB SERVICE TESTING
WEB SERVICE INTRO
WSDL
SOAP
PUTTY TERMINAL
RESTCLIENT PLUGIN
TESTING EXAMPLES
2. WHAT IS WEB SERVICE?
• Web means HTTP protocol and Services means
request – response.
• Web services are web application components and
it can be published, found and used on the Web.
• Web services communicate using open protocols
• Web services have no GUI.
• Web services are a simple interface using HTTP
protocol
3. FROM WHERE IT’S COME
• Web services can be:
• developed by one company,
• used by another company, and
• hosted by a third company.
• Such involvement of several companies is a
business cases for independent testing of web
services.
4. WHAT WE CAN DO WITH IT?
• Web services is a stateless protocol
• we send a request,
• we receive a response,
5. WEB SERVICES HAVE TWO TYPES
OF USES
• Reusable application-components.
• There are things applications need very often. So why make these over and over
again?
• like: currency conversion, weather reports, or even language translation as
services.
• Connect existing software.
• Web services can help to solve the interoperability problem by giving different
applications a way to link their data.
• With Web services you can exchange data between different applications and
different platforms.
6.
7. WSDL
(WEB SERVICES DESCRIPTION
LANGUAGE)
WSDL STANDS FOR WEB SERVICES DESCRIPTION
LANGUAGE
WSDL IS A LANGUAGE FOR DESCRIBING WEB SERVICES
AND HOW TO ACCESS THEM.
WSDL IS AN XML-BASED LANGUAGE FOR DESCRIBING
WEB SERVICES.
WSDL IS ALSO USED TO LOCATE WEB SERVICES
8. THE WSDL DOCUMENT
STRUCTURE
Element Description
<types> A container for data type definitions used by the web service
<message> A typed definition of the data being communicated
<portType> A set of operations supported by one or more endpoints
<binding> A protocol and data format specification for a particular port
type
9. OPERATION TYPES
THE REQUEST-RESPONSE TYPE IS THE MOST COMMON
OPERATION TYPE, BUT WSDL DEFINES FOUR TYPES:
Type Definition
One-way The operation can receive a message but will not return a
response
Request-response The operation can receive a request and will return a
response
Solicit-response The operation can send a request and will wait for a
response
Notification The operation can send a message but will not wait for a
response
12. WEB SERVICE
TESTING
TO VERIFY THE WEB SERVICE EITHER USE OF BELOW
TECHNIQUE
SOAP
PUTTY TERMINAL
RESTCLIENT PLUG IN
13. SOAP(SIMPLE OBJECT ACCESS PROTOCOL)
• SOAP is an XML based protocol for accessing Web
Services.
• SOAP is a communication protocol between applications
• SOAP is a format for sending messages
• SOAP communicates via Internet
• SOAP is platform & language independent
• SOAP is simple and extensible
• SOAP allows you to get around firewalls
14. SOAP BUILDING BLOCKS
• A SOAP message is an ordinary XML document
containing the following elements:
• An Envelope element that identifies the XML document
as a SOAP message
• A Header element that contains header information
• A Body element that contains call and response
information
• A Fault element containing errors and status information
16. THE SOAP ENVELOPE ELEMENT
• The required SOAP Envelope element is the root element of
a SOAP message. This element defines the XML document
as a SOAP message.
• Example
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.XYZ.com/2001/12/soap-envelope"
soap:encodingStyle="http://www.XYZ.com/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>
17. THE SOAP HEADER ELEMENT
• The optional SOAP Header element contains application-specific information (like
authentication, payment, etc) about the SOAP message.
• If the Header element is present, it must be the first child element of the Envelope
element.
• Note: All immediate child elements of the Header element must be namespace-qualified.
• <?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.XYZ.com/2001/12/soap-envelope"
soap:encodingStyle="http://www.XYZ.com/2001/12/soap-encoding">
<soap:Header>
<m:Trans xmlns:m="http://www.XYZ.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>
• The example above contains a header with a "Trans" element, a "mustUnderstand"
attribute with a value of 1, and a value of 234.
18. THE SOAP BODY ELEMENT I
• The required SOAP Body element contains the actual SOAP message intended for the ultimate
endpoint of the message. Immediate child elements of the SOAP Body element may be
namespace-qualified.
• Example
• <?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.XYZ.com/2001/12/soap-envelope"
soap:encodingStyle="http://www.XYZ.com/2001/12/soap-encoding">
<soap:Body>
<m:GetPrice xmlns:m="http://www.xyz.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
• The example above requests the price of apples. Note that the m:GetPrice and the Item
elements above are application-specific elements. They are not a part of the SOAP namespace.
19. THE SOAP BODY ELEMENT II
• A SOAP response could look something like this:
• <?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.XYZ.com/2001/12/soap-envelope"
soap:encodingStyle="http://www.XYZ.com/2001/12/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
20. THE SOAP FAULT ELEMENT
• The optional SOAP Fault element is used to indicate error messages. If a Fault
element is present, it must appear as a child element of the Body element. A
Fault element can only appear once in a SOAP message.
• The SOAP Fault element has the following sub elements:
Sub Element Description
<faultcode> A code for identifying the fault
<faultstring> A human readable explanation of the fault
<faultactor> Information about who caused the fault to happen
<detail> Holds application specific error information related to the Body
element
21. THE HTTP PROTOCOL
• HTTP communicates over TCP/IP. An HTTP client connects to an HTTP
server using TCP. After establishing a connection, the client can send
an HTTP request message to the server:
22. THE HTTP PROTOCOL
• The server then processes the request and sends an HTTP
response back to the client. The response contains a status
code that indicates the status of the request:
• In the example below, the server returned a status code of
200. This is the standard success code for HTTP.
23. THE HTTP PROTOCOL
• If the server could not decode the request, it could have
returned something like this:
24. A SOAP REQUEST EXAMPLE
• In the example below, a GetStockPrice request is sent to a server. The request has
a StockName parameter, and a Price parameter that will be returned in the
response. The namespace for the function is defined in
http://www.example.org/stock".
35. TESTING EXAMPLES
WEB SERVICE CONTENT TESTING
WEB SERVICE ERROR LOG TESTING
INTERACTING WEB SERVICE FUNCTIONAL TESTING
36. WEBSERVICE CONTENT TESTING EX
• Scenarios : Wrong Tracking code is being added to new site
bookings when billing country Sweden
37. WEBSERVICE ERROR LOG
TESTING EX.I
• Scenarios : Verify invalid url is redirect to 404 page and CQ log does not throw
any error or exception.
• Actual result : 20.08.2013 17:59:44.441 *ERROR* [10.199.57.1
[1377017984435] GET /error500.html HTTP/1.1]
org.apache.sling.servlets.resolver.internal.SlingServletResolver Original error null
•
Expected result: in CQ log after hit on invalid URL
10.10.2013 15:10:27.301 *INFO* [172.23.128.81 [1381414227295] GET
/abc.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl
service: Resource /content/vaa/abc.html not found
38. WEBSERVICE ERROR LOG
TESTING EX.II
• Scenarios : In Find address functionality, Web service thrown error
when the response contains symbol as “&” (ampersand)
Verify Find address functionality working fine for specific country.
Verify in Putty terminal, Error does not occurring while performing
search on find address.
• Before fixed the issue result is
"20.08.2013 17:50:49.450 *ERROR* [10.201.57.1 [1377017449220] GET
/etc/designs/vaa/json/lookup.address.json HTTP/1.1]
com.lbi.vaa.lookup.address.WesalAddressService Error calling address lookup
java.lang.IllegalArgumentException: could not unmarshall XML:
<AddressLookup_RS xmlns=""http://schemas.virgin-
atlantic.com/CustomerService/AddressLookup/Services/AddressLookUp/2010/""
>