Many integrations still run on SOAP: payment providers, logistics, insurance, public sector systems. Their test environments are often slow or hard to get access to. Import the WSDL into Mockhop and you get mock endpoints that answer with SOAP envelopes.
Import the WSDL
Open your project, go to Import/Export and, on the Import tab, choose WSDL (SOAP). Paste the WSDL, or enter its URL and select Fetch from URL. Mockhop reads WSDL 1.1 files.
Mockhop then creates:
- an endpoint for the service address in the WSDL (
POST) - a sample SOAP response for each operation
- matching rules that route each request to its operation by
SOAPAction
Clients that request the service address with ?wsdl get the imported WSDL back.
SOAP versions
- SOAP 1.1:
text/xml, with the action in theSOAPActionheader. - SOAP 1.2:
application/soap+xml, with the action in theContent-Type.
Routing requests
Besides SOAPAction, matching rules can look into the XML:
- XPath: a value at a path, for example
//GetOrder/orderId. - XML element: the value of an element by name.
Operators include equals, contains, starts with, ends with, regex, exists and not exists. That way, orderId 48213 can get a different answer than every other order.
Responses built from the request
Templates work in SOAP responses too. For example, a response can repeat the id element from the request:
<id>{{ xmlElement .body "id" }}</id>
Other XML template functions:
| Function | What it does |
|---|---|
xmlPath |
Reads a value by XPath. |
soapAction |
Returns the request's action. |
soapEnvelope |
Wraps content in a SOAP envelope with your namespace. |
soapFault |
Builds a SOAP fault from a fault code, a message and details. |
xmlEscape, xmlCDATA |
Help with special characters. |
Delays, error rates and timeouts work the same as for REST endpoints; see Simulate API errors.
Good to know
- Plans: SOAP mocks are part of the Pro, Team and Business plans.
- Counting: each SOAP call counts as one request, and so does a
?wsdlrequest. - Internal networks: to fetch a WSDL from an internal network or to run SOAP mocks next to internal systems, use a self-hosted installation. The cloud version only fetches public addresses.
Other import formats: Import an OpenAPI file. Plans: pricing.