Blog
Web Services Testing: REST, SOAP and GraphQL Guide

Adwitiya Pandey
Published on

Table of contents
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Users only ever see the screen. But behind every click, web services are doing the real work: taking payments, fetching customer records, checking stock, syncing CRMs and ERPs, and talking to partners' systems. When one of them goes wrong, the screen might look fine while the order, payment or record underneath is wrong.
Web services testing is how you check that layer. It makes sure services return the right data, handle errors properly, stay secure and cope with real traffic.
For years, teams tested services and screens separately: API checks in Postman, UI tests in Selenium. That meant duplicated effort and, worse, gaps where the two meet. Many of the bugs users actually hit live in those gaps.
In this guide, we'll cover what web services testing is, how REST, SOAP and GraphQL differ, the main types of testing, worked request examples, best practices, microservices and performance testing, and why testing services and screens together catches more bugs.
What is Web Services Testing?
Web services testing checks the APIs and services that let applications talk to each other. UI testing looks at what users see. Web services testing looks at the machine-to-machine requests behind it.
Every time an app fetches data, processes a payment, logs a user in, updates a database or calls an outside service, it does it through a web service. Testing makes sure each of those requests:
Returns the right data in the right format
Handles bad input and errors properly
Only lets the right people do the right things
Responds fast enough, even under load
Keeps working when other services change
Services act as contracts between systems, so a small bug can spread a long way: wrong prices, failed payments, broken logins, corrupted data or outages in other systems that depend on them.
Types of Web Services: REST, SOAP and GraphQL
REST | SOAP | GraphQL | |
|---|---|---|---|
How it works | HTTP methods (GET, POST, PUT, PATCH, DELETE) on resources at URLs | XML messages in a standard envelope, described by a WSDL contract | One endpoint, where the client asks for exactly the fields it needs |
Data format | Usually JSON | XML | JSON |
Contract | Often an OpenAPI specification | WSDL | A schema |
Where you'll find it | Most modern web and mobile apps | Banking cores, insurance, healthcare and older ERP integrations | Apps that need flexible data, like mobile apps and dashboards |
What to test | Status codes, response data and schemas, every method | XML structure, WSDL compliance, faults and WS-Security | Query results, response shape, errors and query limits |
REST APIs
REST is the most common style today. Each request uses an HTTP method on a resource, and usually returns JSON. Because REST requests don't depend on a stored session, each one can be tested on its own, which makes REST relatively easy to test.
Here's a typical request and response for a banking app:
HTTP
SOAP Web Services
SOAP came before REST and is still common in enterprise systems. Messages are XML, wrapped in a standard envelope, and a WSDL document describes exactly what operations are available and what the messages look like.
XML (SOAP request)
GraphQL APIs
GraphQL uses a single endpoint. Instead of calling several REST endpoints, the client sends a query listing exactly the fields it wants. That saves data, but it also means testing has to cover many possible query shapes.
GraphQL
Microservices
In a microservices architecture, an app is split into many small services, like stock, pricing, orders, payments and delivery, each with its own API and release schedule. That makes testing harder. Services change at different times, contracts need to stay stable while the code behind them changes, and whole workflows cross many services.
For more on how testing changes when you split a system into services, read our guide to microservices vs monolithic testing strategies.
Why Web Services Testing Matters
Simple Screens Hide Complex Services
Booking a flight looks like one action. Behind it, the app checks availability, works out the price, checks the payment method, creates the booking, sends a confirmation and updates loyalty points, each through a different service. Every one is a place something can go wrong, and some problems only show up with particular data, at busy times or when a service is slow.
API-First Development
Many teams now build and test APIs before the screens, so front-end and back-end work can happen in parallel, and web, mobile and partner apps can all use the same services. That only works if the APIs are tested thoroughly from the start.
Third-Party Services Change Without Warning
Apps rely on outside services for payments, email, SMS, analytics, CRM and much more. Those providers release new versions on their own schedules. Testing makes sure your app keeps working, or fails gracefully, when they do.
Types of Web Services Testing
Type | What It Checks |
|---|---|
Requests return the right data, status codes and structure, and business rules like pricing and validation work, for both valid and invalid input | |
Security | Authentication (OAuth 2.0, JWT, API keys), permissions, input handling, encryption, rate limits and error messages that don't leak details |
Several services, databases and third parties work together in real workflows | |
Contract | Services keep the agreements other services depend on |
Performance and load | Response times, throughput, behaviour under many requests at once, and how services cope with spikes |
Changes to a service don't break anything that used to work |
For a ready-made list of checks across these types, see our collection of API testing test cases.
REST API Testing Best Practices
Cover Every Method, Not Just GET
Teams often test GET requests well and skip the rest. POST, PUT, PATCH and DELETE change data, so they need just as much attention, including checking the change actually saved and that errors are handled.
Check Status Codes for Success and Failure
Code | Meaning | Test It With |
|---|---|---|
200 OK | The request worked | A valid request |
201 Created | A new resource was created | A valid POST |
204 No Content | It worked, with nothing to return | A valid DELETE |
400 Bad Request | The request was invalid | Missing or badly formatted fields |
401 Unauthorized | The caller isn't logged in | No token, or an expired one |
403 Forbidden | The caller isn't allowed to do this | A valid user asking for someone else's data |
404 Not Found | The resource doesn't exist | An ID that doesn't exist |
429 Too Many Requests | The caller hit a rate limit | Rapid repeated requests |
500 and 503 | Something went wrong on the server | Should never appear for normal requests |
Check the Shape of Responses
Clients rely on responses having the same structure every time. Check that required fields are always there, fields have the right types, and values like status codes come from the allowed list. If a response stops matching the specification, either the API has a bug or the documentation is out of date.
Test Who Can Do What
Authentication checks who the caller is. Authorisation checks what they're allowed to do. Test that requests without a valid token are rejected, that expired tokens fail cleanly, and, most importantly, that one user can't see or change another user's data just by changing an ID in the request.
Test Errors as Carefully as Successes
Good APIs return clear, specific errors that help the caller fix the problem, without giving away anything an attacker could use. Check validation errors, login failures, conflicts and rate limits, not just the happy path.
Use Data-Driven Tests
Rather than writing a separate test for every value, run the same request with many sets of data from a file. One test can then cover dozens of valid, invalid and edge case inputs.
Here's what a simple automated REST check might look like in code:
Java (REST Assured)
SOAP Web Services Testing
Area | What to Check |
|---|---|
WSDL | Start by importing the WSDL. Check requests match its operations and data types, and responses match its structure |
XML structure | Namespaces, element order and data types are correct. Use XPath to find and check specific values in responses |
Faults | Errors return proper SOAP faults. In SOAP 1.2, invalid requests should return a Sender fault and server problems a Receiver fault (Client and Server in SOAP 1.1), each with a useful message |
WS-Security | Encrypted messages decrypt correctly, signatures verify, timestamps are within the allowed window and security tokens work |
Testing Web Services in Microservices
Contract Testing
Contract testing checks that each service keeps its promises to the services that use it, without needing the whole system running. In consumer-driven contract testing, using a tool like Pact, the consuming service publishes what it expects, and the providing service checks it still meets those expectations before release.
For a step-by-step guide, read our article on API contract testing.
Integration Testing Across Services
Contract tests check each connection. Integration tests check the whole workflow. For example: log in, fetch the customer profile, create an order, take payment and send a confirmation. That catches problems that only appear when services work together.
Resilience Testing
In a distributed system, services will sometimes be slow or unavailable. Resilience testing checks timeouts, retries, circuit breakers and fallbacks work, so one failing service doesn't bring everything down. Chaos engineering takes this further by deliberately introducing failures, like killing a service mid-request or adding network delay.
Event-Driven Testing
Many services now communicate through events on queues or streams, rather than direct calls. Testing checks that the right events are published with the right data, that consumers handle duplicates safely, and that the system ends up in the right state, even though things happen in the background.
Performance Testing for Web Services
What to Test | What It Tells You |
|---|---|
Response time | Whether services are fast enough. User-facing services usually need to respond in well under a second, and some real-time systems need far less |
Throughput | How many requests a service can handle per second before it slows down |
Scalability | Whether adding more instances increases capacity as expected, or a bottleneck holds it back |
Stress | What happens past normal limits, and whether the service fails gracefully |
Common Web Services Testing Challenges
Challenge | What Helps |
|---|---|
Several API versions in use at once, like /v1 and /v2 | Test every supported version, so older clients keep working while new ones move on |
Third-party services changing independently | Test against providers' sandbox environments, check against their published specifications, and monitor for failures in production |
Documentation that doesn't match reality | Automatically compare real responses with the OpenAPI specification |
Security weaknesses | Test for injection, broken authentication, exposed data and weak access control on every release |
Separate API and UI test suites | Test journeys that cover both, so you catch bugs where the screen and the service meet |
When you need to change an API without breaking the apps that use it, our guide to API backward compatibility testing shows what to check.
Why Test Services and Screens Together
Postman, SoapUI and similar tools are genuinely useful for checking services during development. But when API tests and UI tests live in separate tools, three problems tend to appear.
Problem | What Happens |
|---|---|
Duplicate upkeep | The same business logic is tested twice, in two tools, and both need updating when it changes. When one gets missed, coverage quietly drops |
Bugs between layers | UI tests use mocked services, and API tests run on their own. Nobody checks whether the screen handles the real response properly, so issues like stale data or misread error codes slip through |
A technical barrier | Writing API tests usually needs knowledge of HTTP, JSON and scripting, which leaves out the testers and analysts who know the business rules best |
Testing both in one journey fixes this. Take a customer placing an order: the test fills in the form on screen, checks the API created the order with the right details, and checks the database shows stock has gone down, all in one test.
How Virtuoso QA Helps with Web Services Testing
What You Need | How Virtuoso QA Helps |
|---|---|
Screens and services in one test | One test can go through the screens, call APIs and check the database, so you see the whole journey, not just one layer |
Tests anyone can read | Tests are written in plain English, so testers and analysts can follow and contribute to API checks, not just engineers |
Tests from your requirements | Touchstone reads your requirements and user stories and drafts tests, each citing its source, with a named person approving each requirement |
Many inputs, one test | Run the same journey with many sets of data from a data table |
Fewer broken UI steps | When the screen changes, Virtuoso QA suggests fixes for your team to approve |
Clear failures | When a test fails, you see the failing step, the request and response, screenshots and logs, with a suggested cause |
Tests in your pipeline | Runs from Jenkins, Azure DevOps and GitHub Actions on every change |
Load testing, SOAP-specific security testing and chaos engineering need specialist tools alongside it.
Here's what an order journey might look like, combining the screen, the API and the database:
To see how journeys like this run across screens, APIs and data, take a look at Virtuoso QA's end-to-end testing.
Related Reads
Web Services Testing FAQs
What is web services testing?
What's the difference between web services testing and API testing?
How is SOAP testing different from REST testing?
What tools are used for web services testing?
Can web services testing be automated?
What should a web services test check?












