Soap.Service.Loader (Soap v2.0.0)

View Source

Reads a WSDL and everything it imports, under rules that keep a hostile document from reaching anything it shouldn't.

What gets followed

Reference found in a documentFrom a local fileFrom a URL
Relative pathRead, inside :import_root if setFetched from the same host
http or https URLSkipped unless the host is allowedFetched if the host is the same or allowed
Absolute path, file:, other schemesSkippedSkipped

Allow more hosts with allow_imports_from: ["host"], or every host with :all. Redirect destinations obey the same rules, and relative imports use the final URL. With :import_root, imports through symlinks below that directory are skipped.

Skipped imports don't fail the load. They appear in unresolved_imports, with the reason. An import the rules allow but that can't be read is an error, because the model would be silently incomplete. To accept a partial model anyway, pass ignore_failed_imports: true, and those imports are listed as :import_failed.

Summary

Functions

Loads from a file path or an http or https URL.

Loads from a string. :base is a path or URL that relative imports resolve against.

Types

result()

@type result() :: %{
  wsdls: [Soap.XML.Element.t()],
  schema: Soap.Schema.t(),
  unresolved_imports: [{String.t(), atom()}]
}

Functions

load(source, opts)

@spec load(String.t(), keyword()) :: {:ok, result()} | {:error, term()}

Loads from a file path or an http or https URL.

load_string(wsdl, opts)

@spec load_string(binary(), keyword()) :: {:ok, result()} | {:error, term()}

Loads from a string. :base is a path or URL that relative imports resolve against.