Lather.Soap.Envelope (lather v1.0.4)
View SourceSOAP envelope builder and parser.
Handles creation and parsing of SOAP 1.1 envelopes with support for headers, namespaces, and fault detection.
Summary
Functions
Builds a SOAP envelope for the given operation and parameters.
Parses a SOAP response and extracts the result or fault.
Functions
Builds a SOAP envelope for the given operation and parameters.
Parameters
operation- The operation name (atom or string)params- Parameters for the operation (map)options- Envelope options
Options
:version- SOAP version (:v1_1or:v1_2, default::v1_1):headers- SOAP headers to include:namespace- Target namespace for the operation
Examples
iex> Envelope.build(:get_user, %{id: 123})
{:ok, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>..."}
Parses a SOAP response and extracts the result or fault.
Parameters
response- HTTP response map with:bodykey containing XML
Returns
{:ok, result}- Successful response with parsed body{:error, fault}- SOAP fault or parsing error