Lather.Wsdl.Analyzer (lather v1.0.48)

View Source

WSDL analysis utilities for extracting service information.

This module provides functions to analyze WSDL documents and extract relevant information for generating service clients.

Summary

Functions

Analyzes a WSDL document and extracts service information.

Generates a summary report of WSDL analysis.

Loads and analyzes a WSDL from a URL or file path.

Functions

analyze(wsdl_content, options \\ [])

@spec analyze(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, any()}

Analyzes a WSDL document and extracts service information.

Parameters

  • wsdl_content - WSDL XML content as a string
  • options - Analysis options

Returns

  • {:ok, service_info} - Extracted service information
  • {:error, reason} - Analysis error

Service Info Structure

%{
  service_name: "ServiceName",
  target_namespace: "http://example.com/service",
  endpoint: "https://example.com/soap",
  operations: [
    %{
      name: "operation_name",
      input: %{message: "InputMessage", parts: [...]},
      output: %{message: "OutputMessage", parts: [...]},
      soap_action: "http://example.com/action"
    }
  ],
  types: [...],
  authentication: %{type: :basic | :wssecurity | :custom}
}

extract_service_info(parsed_wsdl, options)

generate_report(service_info)

@spec generate_report(map()) :: String.t()

Generates a summary report of WSDL analysis.

load_and_analyze(source, options \\ [])

@spec load_and_analyze(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, any()}

Loads and analyzes a WSDL from a URL or file path.

Options

  • :http_options - Options for HTTP requests when loading from URL:
    • :headers - List of {name, value} tuples for request headers
    • :receive_timeout - Timeout for receiving response (milliseconds)
    • :pool_timeout - Timeout for checking out a connection (milliseconds)

All other options are passed to analyze/2.

Examples

# Load with custom timeout
Analyzer.load_and_analyze(url, http_options: [receive_timeout: 30_000])

# Load with authentication header
Analyzer.load_and_analyze(url,
  http_options: [
    headers: [{"Authorization", "Basic " <> Base.encode64("user:pass")}]
  ]
)