Lather.Soap.Body (lather v1.0.42)
View SourceSOAP body utilities.
Provides functionality for creating and managing SOAP body content, including parameter serialization and response parsing.
Summary
Functions
Creates a SOAP body element for the given operation and parameters.
Serializes Elixir data structures to XML-compatible format.
Validates parameters against expected types and constraints.
Functions
Creates a SOAP body element for the given operation and parameters.
Parameters
operation- Operation name (atom or string)params- Operation parameters (map)options- Body options
Options
:namespace- Target namespace for the operation:namespace_prefix- Prefix for the target namespace
Examples
iex> Body.create(:get_user, %{id: 123}, namespace: "http://example.com")
%{
"get_user" => %{
"@xmlns" => "http://example.com",
"id" => 123
}
}
Serializes Elixir data structures to XML-compatible format.
Handles various Elixir types and converts them to XML-safe representations.
Validates parameters against expected types and constraints.
Parameters
params- Parameters to validateschema- Validation schema (map)
Schema Format
The schema is a map where keys are parameter names and values are validation rules:
%{
"id" => [:required, :integer],
"name" => [:required, :string, {:max_length, 50}],
"email" => [:optional, :string, :email]
}