Soap. Service
(Soap v2.0.0)
View Source
A SOAP service, read from a WSDL.
Unlike Soap.Wsdl, this model follows the document's own links, from binding to
port type to message to part to schema element, instead of guessing from names. It
needs no application configuration, and bad input returns {:error, reason}.
{:ok, service} = Soap.Service.load("https://example.com/service?wsdl")
Soap.Service.operations(service)
#=> ["Add", "Subtract"]
{:ok, operation} = Soap.Service.operation(service, "Add", version: "1.2")
operation.soap_action
#=> "http://example.com/Add"Options for load/2 and from_string/2
:import_root- a directory that local imports must stay inside.:allow_imports_from- hosts that imports may be fetched from, or:all. SeeSoap.Service.Loaderfor the full rules.:ignore_failed_imports- accept a partial model when an import can't be read. Otherwise that's an error.:base- forfrom_string/2, the path or URL that relative imports resolve against.:http- aSoap.HTTPimplementation.:http_opts- options passed to it.
Summary
Functions
The endpoint URL for an operation, or nil if no port serves its binding.
The endpoint URLs of every SOAP port.
Loads a service from a WSDL string.
Loads a service from a file path or an http or https URL.
Finds an operation by name.
The operation names the service offers.
The names of the service's SOAP ports.
Types
@type t() :: %Soap.Service{ operations: [Soap.Service.Operation.t()], ports: [Soap.Service.Port.t()], schema: Soap.Schema.t(), target_namespace: String.t() | nil, unresolved_imports: [{String.t(), atom()}] }
Functions
@spec endpoint(t(), Soap.Service.Operation.t(), String.t() | nil) :: String.t() | nil
The endpoint URL for an operation, or nil if no port serves its binding.
With a port name, it's that port's address. Otherwise it's the first port's that serves the operation's binding.
The endpoint URLs of every SOAP port.
Loads a service from a WSDL string.
Loads a service from a file path or an http or https URL.
@spec operation(t(), String.t(), keyword()) :: {:ok, Soap.Service.Operation.t()} | {:error, term()}
Finds an operation by name.
A service can offer an operation on several bindings. Without options, this returns the one on the first port, in document order, that offers it.
Options
:port- the name of awsdl:port. Only its binding is used.:version- the SOAP version,"1.1"or"1.2".:input- the input's name, to choose between overloaded operations.
The operation names the service offers.
The names of the service's SOAP ports.