Lather.Server.RequestParser (lather v1.1.0)

Copy Markdown View Source

Parses incoming SOAP requests and extracts operation details and parameters.

Summary

Functions

Parses a SOAP request XML and extracts the operation name and parameters.

Guesses the SOAP version from request headers (a list of {name, value} pairs): application/soap+xml means SOAP 1.2. Used for error responses produced before the envelope could be parsed.

Functions

parse(soap_xml)

Parses a SOAP request XML and extracts the operation name and parameters.

Returns:

  • {:ok, %{operation: operation_name, params: params_map, soap_version: :v1_1 | :v1_2}}

  • {:error, {:parse_error, reason}}

soap_version is detected from the namespace bound to the Envelope element (SOAP 1.1 when it cannot be determined).

soap_version_from_headers(headers)

@spec soap_version_from_headers([{String.t(), String.t()}]) :: :v1_1 | :v1_2

Guesses the SOAP version from request headers (a list of {name, value} pairs): application/soap+xml means SOAP 1.2. Used for error responses produced before the envelope could be parsed.