2. Roopesh Kohad
• QA Manager/Test Architect with Synerzip
• 13+ years of experience working in Product
development teams leading the Test
Engineering efforts
• Email: roopesh.kohad@gmail.com
• LinkedIn:
http://in.linkedin.com/in/roopeshkohad
3. Shirish Kawatkar
• QA Lead with Synerzip
• 9+ years of experience in software testing in
Microsoft & Open technologies
• Email: shirish@synerzip.com
• LinkedIn:
http://in.linkedin.com/in/shirishkawatkar
4. Agenda
• SOA
– Introduction
– Web Services
– Testing Aspects
• SOAP web services
– Introduction
– Testing
• RESTful web services
– Introduction
– Testing
• SoapUI
– Features
– Demo
5. Agenda Contd…
• Automation
– Custom clients in Open & Microsoft
Technologies
– To automate – Issue Tracking System, TCM, CI
etc.
• Demos
– Create a test case using SoapUI & Integration
test
– Create a test case using WCFClient
– Write a simple client in C# using Visual Studio
– Write a simple client in Java using Eclipse
6. What is SOA?
• Service Oriented Architecture (SOA) is a
software design pattern or philosophy
• Distinct and loosely coupled software pieces
(called services) encapsulating business logic
providing application functionality
• Client (Service Requester) Server (Service
Provider) model
• Independent of any vendor, product or
technology
• Reference -
http://en.wikipedia.org/wiki/Service-oriented_
architecture
9. What is a Service?
• Services are unassociated, loosely coupled
units of functionality that are
– self-contained
– Self-describing
• Well defined interface/contract using
standard protocols
• Independent of any technology or vendor
10. What is a Web service?
• Service which communicates over the
internet or www
• Has API with web methods / operations
• Uses web standards like,
– XML/JSON for defining
• Interface/Contract
• Message architecture & format
– HTTP(s) protocol for communication
11. SOA Examples
• Examples,
– Websites like Portals or Mashups
– Payment Gateways
– Mobile application clients
• Composed of,
– in-house (different department)
– third-party (different vendor)
– public services (government etc.)
12. SOA Testing Challenges
• No User Interface
• Heterogeneous
– Variety of service types, implementation &
technologies
• Third-party service so no control
• Isolation of defects
– Whose responsibility? Provider? Requester? Both?
• How do you know vendor has tested the
service thoroughly?
• If we are a provider, how do we show that it is
worthy of acceptance?
13. SOA Testing Aspects
• Everything has to be tested
– End-to-End
– Service-by-Service
– Interface-by-Interface
– Process orchestration
• End-to-End
– User-Interface testing
• Service Testing
– Functional
• Contract/API
– Non-functional
• Security
• Performance
14. SOA Testing Aspects
• Practices & Techniques
– Continuous Integration & Deployment
– Service virtualization / Mocking
• Test Management
– Framework
– Regression
– Reporting
15. Web Service Types
• SOAP / WSDL
– Simple Object Access Protocol
– Web Services Description Language
• REST / WADL
– Representational State Transfer
– Web Application Description Language
• Others
– XML/JSON-RPC
16. SOAP
• Simple Object Access Protocol
• Interface Endpoint(s), Operation(s)
• Message format XML
• Transport HTTP or others
• WSDL – Web Services Description
Language
– Machine readable
– Automatic code generation (Proxy)
17. SOAP Example
• IP2Geo
– Service
• http://ws.cdyne.com/ip2geo/ip2geo.asmx
– Request-Response
• http://ws.cdyne.com/ip2geo/ip2geo.asmx?
op=ResolveIP
– WSDL
• http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl
18. SOAP Testing
• Testing a SOAP API means manipulating a
request XML and interpreting a response
XML
19. SOAP Testing Tools
• IDE Tools
– Eclipse Web Service Explorer
– WCFTestClient from Visual Studio
• Web-based
– http://wsdlbrowser.com
– http://www.soapclient.com/soaptest.html
• Browser Apps
– Firefox - SOAPClient
– Chrome – wizdler
22. REST
• Representational State Transfer
• Architectural style
• It is NOT a protocol like SOAP. Protocol is HTTP.
• HTTP operations
– GET, POST, PUT, DELETE, TRACE, HEAD, OPTIONS
• Endpoint Resource
• Operations on resource
– Create POST
– Retrieve GET
– Update PUT
– Delete DELETE
23. REST constraints
• Use HTTP methods explicitly
• Be stateless or Idempotent
• Expose directory structure-like URIs
• Transfer XML, JavaScript Object Notation
(JSON), or both
• Etc.
24. REST API Examples
• Twitter: https://dev.twitter.com/rest/public
• Flickr: http://www.flickr.com/services/api
• Google -
https://developers.google.com/maps/docum
entation/timezone/
– Example – Current Time Zone
• Amazon S3 -
http://docs.aws.amazon.com/AmazonS3/late
st/API/APIRest.html
• http://www.thomas-bayer.com/sqlrest/
25. REST API
• Endpoint – Root of API
• List of Resources in a hierarchical manner
– /api/customers/
– /api/customers/1
– /api/customers/1/zipcode
• For each resource
– List of HTTP methods: GET, POST, PUT, DELETE
– For each method
• List of Headers
• Request JSON/XML for POST/PUT
• Response JSON/XML
26. REST Misc
• Sample WADL
• REST APIs are generally not open and
require some kind of authentication
– Basic HTTP authentication
– API Key (linked to an account, eg. Google)
– OAuth
• Further
– XML/JSON processing for verification
– Regular expressions
27. REST Testing
• Testing a REST API means manipulating
the request URI and interpreting the answer
SOA is the philosophy of encapsulating application logic in services with a uniformly defined interface and making these publicly available via discovery mechanisms.
Security:
- Vulnerabilities within system
- Denial-of-Service (DOS)
- Unauthorized access
Performance:
Response time
Throughput
http://www.webservicex.net
http://www.restfulwebservices.net
Some examples of free web services and UDDI registries:
Web services
Credit card verification: https://ws.cdyne.com/creditcardverify/luhnchecker.asmx?wsdl
Census information: http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl
Currency foreign exchange: http://www.xignite.com/xCurrencies.asmx?WSDL
Email address validation: http://www.webservicex.com/ValidateEmail.asmx?WSDL
English dictionary: http://services.aonaware.com/DictService/DictService.asmx?WSDL
Number conversion: http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL
Image converter (e.g. PSD into JPG): http://www.bigislandcolor.com/imageconvert.wsdl
IP address into location: http://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl
Stock quote: http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx?wsdl
Translator (english to chinese): http://fy.webxml.com.cn/webservices/EnglishChinese.asmx?wsdl
FIFA World Cup 2010: http://footballpool.dataaccess.eu/data/info.wso?WSDL
Weather forecast: http://www.webservicex.net/WeatherForecast.asmx?WSDL
UDDI registries
http://hma.eoportal.org/juddi/inquiry
http://registry.gbif.net/uddi/inquiry
http://test.uddi.microsoft.com/inquire
IDE & Web based tools are for one time check
What does Representational State Transfer mean?
- The current state of resource is transferred in XML/JSON form.