How to Test a SOAP API from a WSDL: SOAP 1.1 vs 1.2
Generate SOAP requests from WSDL and linked XSD types, handle JAX-WS namespaces and RPC bindings, choose SOAP 1.1 or 1.2, and debug faults.
SOAP failures often look more mysterious than they are. A service returns HTTP 415, “action not supported,” or a namespace fault, and the request XML looks perfectly reasonable. The missing clue is usually in the contract: SOAP version, binding, endpoint, action, or qualified element names.
The reliable workflow: choose an operation from the correct WSDL binding, start with its generated envelope, preserve its namespaces, send the version-appropriate content type and action, and read the SOAP fault before changing the business payload.
What the WSDL gives you
A WSDL is not merely a sample request. Depending on its version and structure, it connects several pieces:
- Service and port: where a particular binding is exposed.
- Binding: the protocol details, including SOAP 1.1 or SOAP 1.2.
- Operation: the callable action and its input/output messages.
- Schema: element names, namespaces, types, and required structure.
A contract can expose multiple ports or bindings. Do not assume the first endpoint and the first operation belong together.
Start with one operation, not a blank editor
- Load the WSDL from a URL, local file, or pasted XML.
- Choose the Service port / binding in the navigator, then select the intended operation. A SOAP 1.2 port may use a different endpoint or action from its SOAP 1.1 sibling; HTTP GET/POST ports are not SOAP ports.
- Confirm the generated endpoint is appropriate for the environment.
- Fill in required values without removing namespace declarations.
- Check authentication and any application-specific headers.
Imported WSDL endpoints are often production URLs, obsolete hosts, or internal names. Treat the address as contract data to verify, not an instruction to send blindly.
A shareable SOAP request you can open and edit
Open this SOAP 1.1 GetCustomer example in the client. It uses an illustrative endpoint, not a live service, and opening the link does not send anything. Replace the endpoint and operation with those from your service before sending.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:c="urn:customers">
<soap:Header/>
<soap:Body><c:GetCustomer><customerId>42</customerId></c:GetCustomer></soap:Body>
</soap:Envelope> Select Validate to check the envelope and version. Change to SOAP 1.2 and the envelope namespace changes without replacing customerId with a template value. This is not a WS-Security-policy conversion or a full XSD validation: your service can still require a different port, action, field order, or authentication policy. Use Reset to WSDL template only when you want to discard edits; the client asks before replacing an edited request.
For a colleague to reproduce your request, use Share request beside the workspace. The link includes the endpoint, version, action, and body, but not HTTP auth fields, additional HTTP headers, or the SOAP Header. Review sensitive values inside the body yourself. A self-contained URL keeps state in its fragment; server-stored links are an explicit alternative, not encrypted private team storage.
Follow named types and linked XSD files
Java JAX-WS and CXF WSDLs often declare an operation’s global element in one schema and its fields in a named complexType elsewhere. A template with only an empty operation tag is not enough. In the Bug Days SOAP client, load the WSDL by URL so relative xsd:import and xsd:include paths can be fetched, or select the WSDL and its XSD files together. You can also paste each XSD with its schemaLocation filename.
The generated request expands nested named types, shows a sample enum value, and marks optional and repeatable fields. If a linked schema is inaccessible because of CORS or authentication, the client reports it; add the file locally and reload rather than guessing at the missing parameters.
SOAP 1.1 and SOAP 1.2 use different HTTP conventions
| Detail | SOAP 1.1 | SOAP 1.2 |
|---|---|---|
| Envelope namespace | http://schemas.xmlsoap.org/soap/envelope/ | http://www.w3.org/2003/05/soap-envelope |
| Typical content type | text/xml; charset=utf-8 | application/soap+xml; charset=utf-8 |
| Action | Usually a separate SOAPAction HTTP header | Can be an action content-type parameter |
| Fault shape | faultcode, faultstring, detail | Code, Reason, Detail |
Typical SOAP 1.1 request headers
POST /CustomerService HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:GetCustomer" Typical SOAP 1.2 request headers
POST /CustomerService HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="urn:GetCustomer" The binding is the authority. Some SOAP stacks are lenient; enterprise gateways often are not. An HTTP 415 commonly points to the content type or version before it points to the payload.
Namespaces matter more than prefixes
In XML, the prefix is shorthand. The namespace URI carries the identity. These two elements are equivalent if both prefixes resolve to the same URI:
<cus:GetCustomer xmlns:cus="urn:customers">...</cus:GetCustomer>
<c:GetCustomer xmlns:c="urn:customers">...</c:GetCustomer> Removing the namespace, however, produces a different element. “Operation not found” and deserialization errors frequently come from a correct local name in the wrong namespace.
There is a subtler case in Java services: a qualified operation wrapper can contain unqualified child parameters. If the XSD omits elementFormDefault="qualified", local elements have no namespace unless an individual form overrides it. An unprefixed <customerId> below a prefixed wrapper is intentional; adding the wrapper’s namespace to every child can make a server deserialize them as null. RPC-style bindings also have their own operation wrapper and message-part parameter rules.
Read the fault before rewriting the request
The Bug Days response inspector shows the code, reason, nested SOAP 1.2 subcodes, and detail XML together. It recognizes a fault by its SOAP namespace and position inside the Body, not merely because a business payload contains an element named Fault. A service can return a SOAP fault with HTTP 200, so read both the status and the envelope.
<env:Fault xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:app="urn:customers">
<env:Code><env:Value>env:Sender</env:Value>
<env:Subcode><env:Value>app:InvalidCustomerId</env:Value></env:Subcode>
</env:Code>
<env:Reason><env:Text xml:lang="en">Customer ID must be positive.</env:Text></env:Reason>
<env:Detail><app:field>customerId</app:field></env:Detail>
</env:Fault> This fragment belongs inside the response Envelope’s Body. Sender identifies a request-side problem; the application subcode and detail identify which value to fix. Do not treat “no SOAP fault” as proof of business success: some services report errors inside an ordinary response element.
A SOAP fault is structured diagnostic output. Preserve the HTTP status, response headers, fault code, human-readable reason, and detail block. Then classify the failure:
- HTTP 401 or 403: authentication or authorization happened before the operation.
- HTTP 404: verify the concrete endpoint, not just the WSDL URL.
- HTTP 415: verify SOAP version and content type.
- Action mismatch: compare the binding’s action with the HTTP action.
- XML/schema fault: inspect qualified element names, ordering, cardinality, and value formats.
Authentication is not the same as WS-Security
HTTP Basic authentication is an HTTP header. WS-Security places tokens, timestamps, signatures, or encryption inside the SOAP header and may require canonicalization and certificate material. A client that can send Basic auth does not automatically implement a service’s WS-Security policy.
Start from a known-good request or the organization’s policy when signatures, client certificates, NTLM/Kerberos, or vendor-specific security handlers are involved.
Understand browser CORS before blaming SOAP
A browser can reach a service only when the service permits the web origin and required headers, or when a local bridge handles the request. A CORS failure means the browser blocked access to the response; it does not prove the SOAP endpoint rejected the envelope.
Bug Days sends directly to the endpoint you enter. If browser CORS blocks the request, the optional Holy CORS bridge runs on your own machine. It is not a hosted relay. For mTLS, integrated Windows authentication, private PKI policy, or sensitive production workflows, use an approved internal or desktop client.
Keep the evidence intact
Use Raw for the response body as received, or Readable for a formatted XML view that preserves leaf text, mixed content, and CDATA. Download always exports the original response body, not the formatted view. Copy uses the currently selected body or headers view. Timing covers receipt of the complete body, rather than only the first response headers.
Cancel stops the browser from waiting; it cannot undo work already accepted by the SOAP service. The client does not retry a cancelled or timed-out POST automatically. Keep that distinction in mind for operations that create orders or transfer funds.
Minimal SOAP debugging checklist
- Confirm the selected port, binding, and endpoint belong together.
- Match the envelope namespace and content type to SOAP 1.1 or 1.2.
- Use the exact action required by the binding.
- Preserve operation and child-element namespaces.
- Separate HTTP authentication from WS-Security requirements.
- Capture the complete fault and HTTP status before editing the payload.
- Distinguish service errors from browser CORS enforcement.
For the protocol definitions, the W3C SOAP specifications index links to SOAP 1.1 and the SOAP 1.2 recommendations.
The precise SOAP 1.2 fields are documented in the W3C SOAP Fault specification; service ports and bindings are defined in WSDL 1.1.