Repository navigation
Releases
Releases · Nitrino/soap
v2.0.0
WARNING: This release breaks compatibility with 1.x. It's a rewrite with a new API, so code written for 1.x needs changes. The migration guide covers each one.
Breaking changes
Soap.init_modelis gone.Soap.load/2reads the WSDL and returns a client.Soap.calltakes the client and a keyword list of options, instead of positional headers and HTTP options.Soap.call/4returns the decoded result. A SOAP Fault or a failed request returns{:error, %Soap.Fault{}}or{:error, %Soap.Error{}}, not{:ok, response}.- Results use string keys, typed values, and lists for elements that can repeat.
Soap.Response.parseis gone. config :soap, :globalsis no longer read. Everything is set per client or per call.- An unknown operation returns
{:error, %Soap.Error{}}instead of raisingOperationError. - A custom HTTP client must implement
Soap.HTTP. HTTPoison is no longer used, and Req is the default. - By default, WSDL imports from other hosts, by absolute path or by
file:URL are skipped.:allow_imports_fromallows more hosts. - Replies with a DOCTYPE, or over 100 MB, are refused.
- Elixir 1.15 or newer is required.
Added
Soap.load/2,Soap.call/4,Soap.request/4andSoap.build_request/4, configured per client and per call.- A WSDL model that follows binding, port type, message, part and schema instead of guessing from names.
- Schema-aware requests: order, namespaces, validation, and values formatted by type.
- Schema-aware results: lists stay lists, values are typed, and prefixes are gone.
Soap.FaultandSoap.Error, for every failure. Both keep the HTTP reply they came from.- Call options merge with the client's: HTTP headers, SOAP headers, adapter options and telemetry metadata are combined by name, and
nilremoves one. - A
:portoption andSoap.ports/1, to choose the binding and address when a WSDL offers an operation on several. - SOAP 1.2 per client, including Faults with subcodes.
wsdl:import,xsd:include,xsd:redefineand import cycles.- rpc/encoded requests and replies, with
multiReflinks andsoapenc:Array. - WS-Security
UsernameToken, with a plain password or a digest. - MTOM in both directions, and SOAP with Attachments.
Soap.Raw, for prebuilt XML.- A
Soap.HTTPbehaviour for choosing an HTTP client, with Req as the default. - Telemetry events and a logger, with credentials masked.
Soap.Test, for testing code that calls SOAP services.mix soap.gen, which generates a typed client from a WSDL.
Changed
- Results use string keys and no longer create atoms.
- Imports are limited by default: a WSDL can't reach other hosts or read arbitrary files.
- Import host restrictions also apply to scheme-relative URLs and HTTP redirects.
:import_rootrejects imports through symlinks below the root directory.- Loading a WSDL honors
:timeoutand:connect_timeout, including its imports. - Replies with a DOCTYPE are refused.
- Replies are limited to 100 MB, also once decompressed.
:max_reply_sizechanges this. - Most replies decode while they're parsed, with no XML tree in memory.
- Elixir 1.15 or newer is required.
Removed
Soap.init_model,Soap.Wsdl,Soap.Xsd,Soap.Type,Soap.Request.Paramsandconfig :soap, :globals.- The
sweet_xml,xml_builderandhttpoisondependencies.
v1.1.0
v1.0.1
v1.0.0 🎉
v0.2.1
v0.2.0
v0.1.2
v0.1.0
Initial release. A simple low-tested wrapper for sending SOAP requests based on wsdl.
- Parsing base struct from WSDL.
Soap.init_model/2 - Parsing WSDL from file or url.
- List operations from WSDL.
Soap.operations/1 - Execution call requests
Soap.call/4