SlideShare a Scribd company logo
WEB SERVICE TESTING
WEB SERVICE INTRO
WSDL
SOAP
PUTTY TERMINAL
RESTCLIENT PLUGIN
TESTING EXAMPLES
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
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.
WHAT WE CAN DO WITH IT?
• Web services is a stateless protocol
• 􀂾we send a request,
• 􀂾 we receive a response,
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.
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
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
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
A ONE-WAY OPERATION
EXAMPLE:
• <message name="newTermValues">
<part name="term" type="xs:string"/>
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="setTerm">
<input name="newTerm" message="newTermValues"/>
</operation>
</portType >
WSDL REQUEST-RESPONSE
EXAMPLE
<message name="getTermRequest">
<part name="term" type="xs:string"/>
</message>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
WEB SERVICE
TESTING
TO VERIFY THE WEB SERVICE EITHER USE OF BELOW
TECHNIQUE
SOAP
PUTTY TERMINAL
RESTCLIENT PLUG IN
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
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
SKELETON SOAP MESSAGE
<?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>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
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>
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.
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.
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>
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
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:
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.
THE HTTP PROTOCOL
• If the server could not decode the request, it could have
returned something like this:
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".
A SOAP RESPONSE EXAMPLE
PUTTY TERMINAL
OPEN APPLICATION
ADD HOST ENTRY
LOGIN SERVER
EXECUTE THE LINUX/UNIX
COMMAND
Ex: to access a error log file
tail –f error.log
RESTCLIENT PLUG-IN
INSTALL PLUG-IN
OPEN RESTCLIENT
IMPORT WEBSERVICE FILE
SELECT METHOD, PUT URL AND CLICK ON
SEND BUTTON
TESTING EXAMPLES
 WEB SERVICE CONTENT TESTING
 WEB SERVICE ERROR LOG TESTING
 INTERACTING WEB SERVICE FUNCTIONAL TESTING
WEBSERVICE CONTENT TESTING EX
• Scenarios : Wrong Tracking code is being added to new site
bookings when billing country Sweden
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
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/""
>
THANKS

More Related Content

What's hot

Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
Lorna Mitchell
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
Masud Rahman
 
Java web services
Java web servicesJava web services
Java web services
kumar gaurav
 
Web Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri MishraWeb Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri Mishra
Sheshadri Mishra
 
Soap web service
Soap web serviceSoap web service
Soap web service
NITT, KAMK
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
Pradeep Kumar
 
Introduction of WebServices
Introduction of WebServicesIntroduction of WebServices
Introduction of WebServices
Khasim Saheb
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
ecosio GmbH
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
WebServices Basic Introduction
WebServices Basic IntroductionWebServices Basic Introduction
WebServices Basic Introduction
Shahid Shaik
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?
Vijay Prasad Gupta
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
Peter R. Egli
 
Simple object access protocol(soap )
Simple object access protocol(soap )Simple object access protocol(soap )
Simple object access protocol(soap )
balamurugan.k Kalibalamurugan
 
Web services
Web servicesWeb services
Web services
Michael Weiss
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
Mule webservices in detail
Mule webservices in detailMule webservices in detail
Mule webservices in detail
Shahid Shaik
 
WebServices
WebServicesWebServices
WebServices
Sunil Komarapu
 

What's hot (20)

Web Services
Web ServicesWeb Services
Web Services
 
Web service
Web serviceWeb service
Web service
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
Java web services
Java web servicesJava web services
Java web services
 
Web Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri MishraWeb Service Testing By Sheshadri Mishra
Web Service Testing By Sheshadri Mishra
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Introduction of WebServices
Introduction of WebServicesIntroduction of WebServices
Introduction of WebServices
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
WebServices Basic Introduction
WebServices Basic IntroductionWebServices Basic Introduction
WebServices Basic Introduction
 
Soap vs. rest - which is right web service protocol for your need?
Soap vs. rest -  which is right web service protocol for your need?Soap vs. rest -  which is right web service protocol for your need?
Soap vs. rest - which is right web service protocol for your need?
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
Simple object access protocol(soap )
Simple object access protocol(soap )Simple object access protocol(soap )
Simple object access protocol(soap )
 
Web services
Web servicesWeb services
Web services
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
Mule webservices in detail
Mule webservices in detailMule webservices in detail
Mule webservices in detail
 
WebServices
WebServicesWebServices
WebServices
 

Similar to Webservice Testing

Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
Hayati Guvence
 
Web-Services!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptx
ssuserae0316
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
Rajkattamuri
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
Shahid Shaik
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
Khan625
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
Khasim Cise
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overviewRaveendra Bhat
 
Web services intro.
Web services intro.Web services intro.
Web services intro.
Ranbeer Yadav
 
Web services testing
Web services testingWeb services testing
Web services testing
rammikn
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
clairvoyantllc
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
Muhammad Shahroz Anwar
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
Kevin Hazzard
 
API-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptxAPI-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptx
amarnathdeo
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
AbdulImrankhan7
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
ParrotBAD
 
SOAP Overview
SOAP OverviewSOAP Overview
SOAP Overview
elliando dias
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Webservices Testing PPT.pdf
Webservices Testing PPT.pdfWebservices Testing PPT.pdf
Webservices Testing PPT.pdf
AbhishekDhotre4
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
Tiago Knoch
 
Architecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APIArchitecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web API
SHAKIL AKHTAR
 

Similar to Webservice Testing (20)

Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
 
Web-Services!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptx
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
Web services intro.
Web services intro.Web services intro.
Web services intro.
 
Web services testing
Web services testingWeb services testing
Web services testing
 
Webservices Workshop - september 2014
Webservices Workshop -  september 2014Webservices Workshop -  september 2014
Webservices Workshop - september 2014
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
API-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptxAPI-Testing-SOAPUI-1.pptx
API-Testing-SOAPUI-1.pptx
 
Introduction to WebServices
Introduction to WebServicesIntroduction to WebServices
Introduction to WebServices
 
Postman.ppt
Postman.pptPostman.ppt
Postman.ppt
 
SOAP Overview
SOAP OverviewSOAP Overview
SOAP Overview
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Webservices Testing PPT.pdf
Webservices Testing PPT.pdfWebservices Testing PPT.pdf
Webservices Testing PPT.pdf
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Architecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APIArchitecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web API
 

Webservice Testing

  • 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
  • 10. A ONE-WAY OPERATION EXAMPLE: • <message name="newTermValues"> <part name="term" type="xs:string"/> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="setTerm"> <input name="newTerm" message="newTermValues"/> </operation> </portType >
  • 11. WSDL REQUEST-RESPONSE EXAMPLE <message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>
  • 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
  • 15. SKELETON SOAP MESSAGE <?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> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope>
  • 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".
  • 25. A SOAP RESPONSE EXAMPLE
  • 26. PUTTY TERMINAL OPEN APPLICATION ADD HOST ENTRY LOGIN SERVER
  • 27.
  • 28.
  • 29. EXECUTE THE LINUX/UNIX COMMAND Ex: to access a error log file tail –f error.log
  • 30. RESTCLIENT PLUG-IN INSTALL PLUG-IN OPEN RESTCLIENT IMPORT WEBSERVICE FILE SELECT METHOD, PUT URL AND CLICK ON SEND BUTTON
  • 31.
  • 32.
  • 33.
  • 34.
  • 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/"" >