Skip to content

zegohome/soap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7627f6c · Jan 10, 2019
Jan 22, 2018
Dec 21, 2017
Jan 10, 2019
Feb 7, 2018
Jan 9, 2018
Dec 21, 2017
Dec 26, 2017
Jan 12, 2018
Feb 9, 2018
Dec 21, 2017
May 21, 2018
May 21, 2018
May 21, 2018

Repository files navigation

Soap

Build Status

Pure Elixir implementation of SOAP client

NOTE: Library is NOT production ready before 1.0 version

Installation

  1. Add soap to your deps:
def deps do
  [{:soap, "~> 0.1.1"}]
end
  1. Add soap to the list of application dependencies
def application do
  [applications: [:logger, :soap]]
end
  1. Add configuration:
config :soap, :globals, version: "1.1"

config :soap, http_opts: [recv_timeout: 20_000, timeout: 20_000]

Usage

wsdl_path = "https://git.io/vNCWd"
action = "SendMessage"
params = %{recipient: "1", body: ""}

# Parse wsdl file for execution of action on its basis
{:ok, wsdl} = Soap.init_model(wsdl_path, :url)

# Call action
%Soap.Response{body: body, headers: headers, request_url: url, status_code: code} = Soap.call(wsdl, action, params)

# Parse body
Soap.Response.parse(body, code)