Import a SOAP / WSDL service
The WSDL importer (wsdl) reads a SOAP service description, WSDL 1.1 or 2.0, into the
Catalog. Its XSD types become types, and each port-type operation becomes an
operation. You can then search, version, diff and convert it like any other catalog item.
When to use it
Use the WSDL importer for any SOAP service: WSDL 1.1 or 2.0 descriptions with SOAP 1.1, SOAP 1.2 or HTTP bindings, and the XML Schema types they carry or import. Bring the description in as one file, as a set of files that import each other, or point Apiome at the running service (WCF and ASMX endpoints included). For an XML Schema on its own, with no service around it, use the XSD importer instead.
At a glance
| Step | Where | Details |
|---|---|---|
Import a .wsdl file | Import to catalog → WSDL, or apiome import wsdl | Import it |
| Import a description split across files | Upload a .zip, .tar.gz or .tar, or apiome import wsdl ./folder/ | A description split across files |
| Discover a running SOAP service | URL Import with its ?wsdl URL, or apiome import wsdl --discover | Discover a live service |
| See what the description became: services, messages, faults, servers | The catalog item | What the catalog item records |
| Check the bindings and imports against the WS-I Basic Profile | Automatic on every import; problems show in lint | WS-I Basic Profile checks |
| Compare two versions by SOAP and XML Schema compatibility | Tick two versions on the catalog item's Versions tab | Breaking changes between versions |
| Convert to an OpenAPI project | Convert to OpenAPI on the catalog item | Per-format conversion packs |
| Export back to WSDL (1.1 or 2.0) and XSD | Export on the catalog item | WSDL and XSD from any source · WSDL 2.0 |
Import it
| What you have | How to bring it in |
|---|---|
One .wsdl file | Upload, paste or link it in the import wizard (Import to catalog → WSDL), or apiome import wsdl ./service.wsdl. |
| A WSDL that imports other files | Upload them together as a .zip, .tar.gz or .tar, or apiome import wsdl ./service-folder/. |
| A running SOAP service | Enter its ?wsdl URL in URL Import (see In the import wizard), or apiome import wsdl --discover https://host/Service.svc |
What the catalog item records
| WSDL | Catalog item |
|---|---|
Each portType (1.1) or interface (2.0) | A service, with one operation per WSDL operation |
| An operation's input and output | Its request and response messages |
An operation's wsdl:fault (1.1) or outfault (2.0) | An error message named after the fault, with the fault's payload |
A message with several parts (typical of rpc style) | A type named after the message, with one field per part |
| XSD complex types | Types, with each element's minOccurs, maxOccurs, nillable, default and restrictions |
Each port (1.1) or endpoint (2.0) with an address | A server named after the port, with its binding's protocol (soap11, soap12 or http) |
| The SOAP binding of an operation | Its soapAction, and rpc when the binding uses that style |
Each server also records its WSDL service, binding, port type and SOAP transport, so a description
with SOAP 1.1 and SOAP 1.2 ports keeps both. When you export the item to WSDL (see
Export a specification), its bindings,
services, ports, faults, multi-part messages and XSD types — with each element's occurrence,
nillable, default, restrictions and original XSD type such as dateTime or decimal — are written
out again, so a re-import of the export matches the item.
A description split across files
A WSDL often pulls in other documents:
<xs:import schemaLocation="types.xsd">,<xs:include>,<xs:redefine>and<xs:override>inside<wsdl:types>bring in XML Schema files;<wsdl:import location="contract.wsdl">(WSDL 1.1 and 2.0) and<wsdl:include>(WSDL 2.0) bring in another description with its own messages, port types or interfaces, bindings and services. WCF services publish their contract this way.
When you upload the files together, every one of them is read, at any depth, and the API is cataloged as one: types from the schemas, and messages and operations from the imported descriptions. Each location is found the way a SOAP toolkit finds it:
- Relative to the file that declares it.
../schemas/orders.xsdinwsdl/orders.wsdlisschemas/orders.xsdin the upload, so a set laid out in folders imports as it is. - As written, for a description fetched from a live service.
- By file name, when only one file in the upload has that name. When two files share the name, neither is guessed.
A location nothing in the upload answers, or a file that is not well-formed XML, is skipped, and the
types it would have supplied stay unresolved. Lint reports it as
wsi.unresolved-import, and the catalog item lists it under
xml_import_graph (see below). Each file is read once, so an import cycle ends.
What the catalog item keeps about its files
| Key | Holds |
|---|---|
xml_import_graph | For a description split across files: each file read (path, and kind: wsdl or schema), the root first, and each location nothing answered (declared_in, location, reason: missing or unreadable) |
xml_c14n_sha256 | A SHA-256 over every file read, in Canonical XML (xml_c14n_algorithm: sha256-c14n2-v1) |
xsd_version | 1.1 when a schema it reads is XSD 1.1; absent for XSD 1.0 |
The canonical XML hash is computed after every import is resolved. It ignores how each file is
written: whitespace, comments, attribute order and namespace prefixes (xs: or xsd:, including
inside type="tns:Order"). It changes when anything else does, in the root file or in any file it
imports, xs:documentation included. It is the item's format hash. A new catalog version is still
decided by the catalog's own fingerprint, so a documentation-only edit or a renamed file creates no
version.
A schema is XSD 1.1 when it says so (vc:minVersion="1.1") or uses an XSD 1.1 element, such as
xs:assert, xs:alternative or xs:openContent. Its types are read as they are in XSD 1.0;
assertions and type alternatives are not part of the catalog item.
Discover a live service
In the import wizard
- On the Catalog, click “Import to catalog” and choose URL Import.
- Enter the service's description URL as the Document URL, for example
https://soap.example.com/Calculator.svc?wsdl. A bare WCF or ASMX endpoint (…/Calculator.svc,…/Service.asmx) works too. - Click “Fetch and detect”.
The wizard asks the service for ?singleWsdl first, the whole description with its imports
inlined, and uses ?wsdl when the service does not offer it. The catalog item records the URL
that answered. A .wsdl URL, a ?singleWsdl URL or any other URL is fetched as you entered it.
The fetch runs in your browser, so the service must allow requests from Apiome (CORS). A ?wsdl
description whose schemas are separate documents (?xsd=xsd0) arrives without them in the wizard.
For such a service, use the CLI or upload the files together.
From the CLI
Give --discover the service endpoint (or its ?wsdl URL):
apiome import wsdl --discover https://soap.example.com/Calculator.svc
The CLI asks the service for its description:
?singleWsdlfirst. WCF services answer it with the whole description in one document, every import already inlined.?wsdlwhen?singleWsdlis not offered.
It reports the URL that answered (Discovered WSDL at …) and imports that document like a --url
import. A ?singleWsdl or .wsdl URL is used as given. --discover must be the only input.
A ?wsdl description that imports other documents by URL arrives without them. For such services,
use ?singleWsdl when the service offers it, or save the files and upload them together.
Try it with the CLI fixtures
The CLI's test fixtures, in apiome-cli/tests/fixtures/, include one description of each kind:
| Fixture | What it is |
|---|---|
calculator-soap11.wsdl | WSDL 1.1, document/literal, with a fault and SOAP 1.1 and SOAP 1.2 bindings |
shipping-wsdl20.wsdl | WSDL 2.0, with in-out and robust-in-only operations |
orders-wsdl-set/ | A WSDL 1.1 description in wsdl/ whose types live in schemas/ |
apiome import wsdl apiome-cli/tests/fixtures/shipping-wsdl20.wsdl
apiome import wsdl apiome-cli/tests/fixtures/orders-wsdl-set/
WS-I Basic Profile checks
Every imported description is checked against the
WS-I Basic Profile, the rules SOAP
toolkits follow to interoperate. The checks read the bindings and imports exactly as written,
including those in the files the description imports. Problems never stop the import; each is
listed on the catalog item (wsdl_wsi_issues, up to 50, with wsdl_wsi_issue_count) and reported
by lint at a path such as wsdl:/binding/OrdersSoap/operation/GetOrder/input.
| Rule | Severity | What it catches |
|---|---|---|
wsi.literal-use | error | A soap:body, soap:header, soap:headerfault or soap:fault with use="encoded". Only literal is interoperable. |
wsi.binding-style | error | One binding that mixes rpc and document operations. |
wsi.document-literal | error | A document-literal body that references more than one part, a part defined with type rather than element, or that carries a namespace attribute. |
wsi.rpc-literal | error | An rpc-literal body that references a part defined with element, or has no namespace. |
wsi.unique-operation-signature | error | Two operations of a binding that send the same body element with the same soapAction, so a receiver cannot tell them apart. |
wsi.unresolved-import | error | A wsdl:import, xs:import or xs:include that resolves to nothing in the import, or an xs:import without schemaLocation whose namespace no schema declares. |
wsi.wsdl-import-target | error | A wsdl:import with no location, or one that names a schema instead of a WSDL description. Import schemas with xs:import inside wsdl:types. |
wsi.unique-soap-action | warning | Two operations of a binding that share a soapAction, which a service that routes on it cannot tell apart. |
The binding rules apply to SOAP 1.1 and SOAP 1.2 bindings in WSDL 1.1; for WSDL 2.0, only the import rules apply.
A single .wsdl uploaded without the schemas it imports reports each of them as
wsi.unresolved-import. Upload the files together, use ?singleWsdl, or discover the live service,
and import it again.
Breaking changes between versions
When you compare two versions of a WSDL catalog item, each change is graded by SOAP and XML
Schema compatibility. The import records what these rules need: each operation's message exchange
pattern and its SOAP binding's soapAction and style, and each element's minOccurs, maxOccurs,
nillable, default and simple-type restrictions (enumeration, pattern, length,
minLength / maxLength, minInclusive / maxInclusive, minExclusive / maxExclusive,
totalDigits, fractionDigits).
SOAP services validate messages strictly: a receiver that does not know an element rejects the message. So in XML Schema, adding is not automatically safe: a new optional element is dangerous, and a looser restriction is dangerous too.
| Change | Severity | Rule |
|---|---|---|
| An operation's message exchange pattern changed | Breaking | wsdl.mep-changed |
An operation's soapAction changed | Breaking | wsdl.soap-action-changed |
An operation moved between rpc and document style | Breaking | wsdl.soap-style-changed |
A required element added (minOccurs 1 or more) | Breaking | wsdl.element-added-required |
An optional element added (minOccurs="0") | Dangerous | wsdl.element-added-optional |
| An element's type changed | Breaking | wsdl.element-type-changed |
minOccurs raised / lowered | Breaking / Dangerous | wsdl.min-occurs-raised / wsdl.min-occurs-lowered |
maxOccurs lowered / raised | Breaking / Dangerous | wsdl.max-occurs-lowered / wsdl.max-occurs-raised |
nillable turned off / on | Breaking / Dangerous | wsdl.made-non-nillable / wsdl.made-nillable |
An element's default changed | Dangerous | wsdl.default-changed |
A restriction tightened: an enumeration value removed, a facet added, a bound tightened, a pattern or base type changed | Breaking | wsdl.facet-narrowed |
| A restriction loosened: an enumeration value added, a facet removed, a bound loosened | Dangerous | wsdl.facet-widened |
Only the spelling changed (maxOccurs="1" written out) | Safe | wsdl.element-unchanged-on-the-wire |
New operations and types are safe, and anything removed is breaking. Standalone .xsd catalog
items are graded by the standard rules.
Related
- Import a specification: the import paths every format shares
- Supported formats: WSDL's version coverage and export support
- Import a SoapUI or ReadyAPI project: a SOAP project with its WSDLs and test suites