All posts
EngineeringAPI testingGraphQLgRPCWebSocketSOAPmulti-protocol

Multi-Protocol API Testing: REST, GraphQL, gRPC, WebSocket & SOAP

QuantumVerifi now tests APIs across five protocols — auto-detected from your spec. One input, protocol-aware tests, security analysis, and self-healing.

QuantumVerifi Team30 March 20265 min read

API testing used to mean "send a GET, check the status code." That hasn't been true for years. Modern backends serve REST, GraphQL, gRPC, WebSocket, and SOAP — sometimes all from the same codebase. Until today, QuantumVerifi's API mode only spoke REST.

Now it speaks all five.

The Problem#

You have a GraphQL API. You paste the endpoint into an API testing tool. It tries to parse it as OpenAPI. It fails. You switch tools. The new tool generates GraphQL tests but doesn't know that GraphQL always returns HTTP 200 — even on errors. Half your tests pass when they shouldn't.

This is the protocol gap. Every protocol has its own transport, error semantics, and security surface. Generic HTTP testing misses all of it.

How It Works#

1. Auto-Detection

You provide a spec URL or endpoint. QuantumVerifi figures out the protocol:

SignalProtocol
swagger or openapi key in specREST
__schema key or /graphql in URLGraphQL
syntax = "proto in content or .proto URLgRPC
ws:// scheme or /ws in URLWebSocket
<wsdl: in content or ?wsdl in URLSOAP

If auto-detection isn't confident, you can set the protocol explicitly in the UI. The detection chain runs in milliseconds with zero LLM cost.

2. Protocol-Aware Discovery

Each protocol has its own discovery mechanism:

  • REST: Fetches OpenAPI/Swagger spec, falls back to endpoint probing at standard paths
  • GraphQL: Sends an introspection query to discover the full schema — queries, mutations, subscriptions, types, and arguments
  • gRPC: Probes for server reflection to discover available services and methods
  • WebSocket: Connects to the endpoint to discover supported events and message formats
  • SOAP: Parses the WSDL to extract operations, ports, and message schemas

3. Protocol-Aware Test Generation

This is where it gets interesting. The AI generates tests that understand protocol semantics:

REST — Standard HTTP assertions:

JavaScript
const response = await api.get('/users/1'); expect(response.status).toBe(200); expect(response.data).toHaveProperty('email');

GraphQL — Single endpoint, errors in response body:

JavaScript
1const response = await gql(` 2 query { user(id: "1") { name email } } 3`); 4// GraphQL ALWAYS returns 200 — errors are in the body 5expect(response.data.errors).toBeUndefined(); 6expect(response.data.data.user.name).toBeDefined();

gRPC — Service/method calls with status codes:

JavaScript
const response = await callGRPC('UserService', 'GetUser', { id: '1' }); expectGRPCSuccess(response); expect(response.data.name).toBeDefined();

WebSocket — Connection lifecycle and async messages:

JavaScript
const ws = await wsConnect('/events'); await wsSend(ws, { type: 'subscribe', channel: 'updates' }); const msg = await wsExpectMessage(ws, 5000); expect(msg.type).toBe('subscribed'); await wsClose(ws);

SOAP — XML envelopes with fault handling:

JavaScript
const response = await soapCall('GetUser', { UserId: '1' }); expectSoapSuccess(response); expect(response.data).toContain('<Name>');

4. Protocol-Aware Security Analysis

Each protocol has a distinct attack surface. REST tests for OWASP Top 10 — but GraphQL has introspection exposure, query depth attacks, and batch query abuse. gRPC has reflection exposure and metadata injection. SOAP has XML External Entity (XXE) attacks and WSDL exposure.

QuantumVerifi runs protocol-specific security analysis with 8 categories per protocol:

ProtocolExample Checks
RESTBroken auth, injection, mass assignment, CORS
GraphQLIntrospection in prod, query depth DoS, batch attacks, field-level auth
gRPCReflection exposure, metadata injection, certificate validation, message size
WebSocketOrigin validation, auth on upgrade, message injection, connection flooding
SOAPXXE, WSDL exposure, WS-Security, XML bomb, action spoofing

5. Protocol-Aware Self-Healing

When tests fail, the error clustering engine recognises protocol-specific patterns:

  • GraphQL: cannot query field → schema mismatch, response.data.errors → application error
  • gRPC: UNAVAILABLE → server unreachable, UNIMPLEMENTED → wrong method name
  • WebSocket: wsExpectMessage timeout → server didn't respond, connection refused → wrong endpoint
  • SOAP: SOAP Fault → operation error, SOAPAction → wrong action header

The fix instructions are protocol-aware too. A GraphQL test that checks response.status === 404 gets told: "GraphQL always returns HTTP 200 — check response.data.errors instead."

Using It#

From the UI

The analyse page now shows a protocol selector with six options: Auto, REST, GraphQL, gRPC, WebSocket, and SOAP. Pick one, or leave it on Auto.

The spec URL field adapts its label and placeholder based on protocol:

  • REST → "OpenAPI Spec URL"
  • GraphQL → "GraphQL Endpoint URL"
  • gRPC → "Proto File URL or gRPC Endpoint"
  • WebSocket → "WebSocket Server URL"
  • SOAP → "WSDL URL"

From the API

JSON
1{ 2 "api_spec": "https://api.example.com/graphql", 3 "api_base_url": "https://api.example.com", 4 "api_protocol": "graphql", 5 "api_framework": "jest", 6 "execute_api_tests": true 7}

The api_protocol field is optional. If omitted, auto-detection kicks in.

Test Frameworks

Both Jest (JavaScript/TypeScript) and Pytest (Python) are supported for all five protocols. Each framework gets protocol-specific setup files with pre-built helpers — gql() for GraphQL, callGRPC() for gRPC, wsConnect() for WebSocket, soapCall() for SOAP.

Architecture#

The implementation is LLM-first and universal. There are no custom protocol parsers — the AI reads the spec content (OpenAPI JSON, GraphQL introspection result, proto file, WSDL) and generates protocol-appropriate tests. Detection is deterministic (string matching on spec content and URLs), but everything downstream — endpoint analysis, test generation, security scanning — is AI-generated with protocol-specific prompts and framework guides.

This means adding a new protocol doesn't require building a parser. It requires:

  1. Detection rules (a few string checks)
  2. A framework guide (test examples for jest/pytest)
  3. Setup file helpers (reusable functions)
  4. A security prompt (protocol-specific categories)
  5. Error patterns (for self-healing)

Each protocol is self-contained. REST continues working identically to before.

What's Next#

Multi-protocol API testing is available now on all plans. Point QuantumVerifi at your GraphQL endpoint, gRPC server, WebSocket service, or SOAP WSDL — and get protocol-aware tests, security analysis, and self-healing out of the box.