# `Lather.Server`
[🔗](https://github.com/awksedgreep/lather/blob/v1.0.49/lib/lather/server.ex#L1)

SOAP Server implementation for Lather.

Provides a framework for building SOAP web services in Elixir with:
- Automatic WSDL generation from module definitions
- Request/response handling and validation
- Authentication and authorization support
- Phoenix/Plug integration
- Comprehensive error handling with SOAP faults

## Usage

Define a SOAP service module:

    defmodule MyApp.UserService do
      use Lather.Server

      @namespace "http://myapp.com/users"
      @service_name "UserService"

      @soap_operation %{
        name: "GetUser",
        input: [%{name: "userId", type: "string", required: true}],
        output: [%{name: "user", type: "User"}]
      }
      def get_user(%{"userId" => user_id}) do
        case fetch_user(user_id) do
          {:ok, user} -> {:ok, %{"user" => user}}
          {:error, :not_found} -> soap_fault("Client", "User not found")
        end
      end

      defp fetch_user(id), do: {:ok, %{"id" => id, "name" => "John Doe"}}
    end

Then mount it in your Phoenix router or Plug application:

    # In Phoenix router
    scope "/soap" do
      pipe_through :api
      post "/users", Lather.Server.Plug, service: MyApp.UserService
    end

    # Or as a standalone Plug
    plug Lather.Server.Plug, service: MyApp.UserService

# `__before_compile__`
*macro* 

Callback executed before module compilation to generate service metadata.

# `__using__`
*macro* 

Macro for creating SOAP service modules.

# `format_response`

Formats operation response according to SOAP conventions.

# `soap_fault`

Creates a SOAP fault response.

# `validate_param_types`

Validates parameter types according to operation definition.

# `validate_required_params`

Validates that required operation parameters are present.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
