Skip to main content

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​

StepWhereDetails
Import a .wsdl fileImport to catalog → WSDL, or apiome import wsdlImport it
Import a description split across filesUpload a .zip, .tar.gz or .tar, or apiome import wsdl ./folder/A description split across files
Discover a running SOAP serviceURL Import with its ?wsdl URL, or apiome import wsdl --discoverDiscover a live service
See what the description became: services, messages, faults, serversThe catalog itemWhat the catalog item records
Check the bindings and imports against the WS-I Basic ProfileAutomatic on every import; problems show in lintWS-I Basic Profile checks
Compare two versions by SOAP and XML Schema compatibilityTick two versions on the catalog item's Versions tabBreaking changes between versions
Convert to an OpenAPI projectConvert to OpenAPI on the catalog itemPer-format conversion packs
Export back to WSDL (1.1 or 2.0) and XSDExport on the catalog itemWSDL and XSD from any source · WSDL 2.0

Import it​

What you haveHow to bring it in
One .wsdl fileUpload, paste or link it in the import wizard (Import to catalog → WSDL), or apiome import wsdl ./service.wsdl.
A WSDL that imports other filesUpload them together as a .zip, .tar.gz or .tar, or apiome import wsdl ./service-folder/.
A running SOAP serviceEnter 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​

WSDLCatalog item
Each portType (1.1) or interface (2.0)A service, with one operation per WSDL operation
An operation's input and outputIts 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 typesTypes, with each element's minOccurs, maxOccurs, nillable, default and restrictions
Each port (1.1) or endpoint (2.0) with an addressA server named after the port, with its binding's protocol (soap11, soap12 or http)
The SOAP binding of an operationIts 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:

  1. Relative to the file that declares it. ../schemas/orders.xsd in wsdl/orders.wsdl is schemas/orders.xsd in the upload, so a set laid out in folders imports as it is.
  2. As written, for a description fetched from a live service.
  3. 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​

KeyHolds
xml_import_graphFor 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_sha256A SHA-256 over every file read, in Canonical XML (xml_c14n_algorithm: sha256-c14n2-v1)
xsd_version1.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​

  1. On the Catalog, click “Import to catalog” and choose URL Import.
  2. 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.
  3. 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:

  1. ?singleWsdl first. WCF services answer it with the whole description in one document, every import already inlined.
  2. ?wsdl when ?singleWsdl is 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:

FixtureWhat it is
calculator-soap11.wsdlWSDL 1.1, document/literal, with a fault and SOAP 1.1 and SOAP 1.2 bindings
shipping-wsdl20.wsdlWSDL 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.

RuleSeverityWhat it catches
wsi.literal-useerrorA soap:body, soap:header, soap:headerfault or soap:fault with use="encoded". Only literal is interoperable.
wsi.binding-styleerrorOne binding that mixes rpc and document operations.
wsi.document-literalerrorA 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-literalerrorAn rpc-literal body that references a part defined with element, or has no namespace.
wsi.unique-operation-signatureerrorTwo operations of a binding that send the same body element with the same soapAction, so a receiver cannot tell them apart.
wsi.unresolved-importerrorA 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-targeterrorA 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-actionwarningTwo 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.

ChangeSeverityRule
An operation's message exchange pattern changedBreakingwsdl.mep-changed
An operation's soapAction changedBreakingwsdl.soap-action-changed
An operation moved between rpc and document styleBreakingwsdl.soap-style-changed
A required element added (minOccurs 1 or more)Breakingwsdl.element-added-required
An optional element added (minOccurs="0")Dangerouswsdl.element-added-optional
An element's type changedBreakingwsdl.element-type-changed
minOccurs raised / loweredBreaking / Dangerouswsdl.min-occurs-raised / wsdl.min-occurs-lowered
maxOccurs lowered / raisedBreaking / Dangerouswsdl.max-occurs-lowered / wsdl.max-occurs-raised
nillable turned off / onBreaking / Dangerouswsdl.made-non-nillable / wsdl.made-nillable
An element's default changedDangerouswsdl.default-changed
A restriction tightened: an enumeration value removed, a facet added, a bound tightened, a pattern or base type changedBreakingwsdl.facet-narrowed
A restriction loosened: an enumeration value added, a facet removed, a bound loosenedDangerouswsdl.facet-widened
Only the spelling changed (maxOccurs="1" written out)Safewsdl.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.