Skip to content

Commit

Permalink
Improve Soap module doc (#66)
Browse files Browse the repository at this point in the history
* Improve Soap module doc

* improve docs
  • Loading branch information
Nitrino authored Feb 14, 2019
1 parent 82c0bc3 commit 423efd3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/soap.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ defmodule Soap do
for validation parameters when we build request body.
The `Soap` module can be used to parse WSDL files:
```
iex> Soap.init_model("https://git.io/vNCWd", :url)
{:ok, %{
complex_types: [...],
Expand All @@ -33,10 +34,12 @@ defmodule Soap do
validation_types: %{...}
}
}
```
And send requests:
```elixir
iex> Soap.call(wsdl, action, params)
{:ok, %Soap.Response{}}
```
It's very common to use Soap in order to wrap APIs.
See `call/5` for more details on how to issue requests to soap services
Expand Down Expand Up @@ -65,7 +68,8 @@ defmodule Soap do

@doc """
Send a request to the SOAP server based on the passed WSDL file, action and parameters.
Returns `{:ok, %Soap.Response{}}` if the request is successful, {:error, reason} otherwise.
Returns `{:ok, %Soap.Response{}}` if the request is successful, `{:error, reason}` otherwise.
## Parameters
Expand Down
3 changes: 2 additions & 1 deletion lib/soap/response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ defmodule Soap.Response do

@doc """
Executing with xml response body as string.
parse/1 returns a full parsed response structure as map.
Function `parse/1` returns a full parsed response structure as map.
"""
@spec parse(__MODULE__.t() | String.t(), integer()) :: map()
def parse(%Soap.Response{body: body, status_code: status_code}), do: parse(body, status_code)
Expand Down
3 changes: 2 additions & 1 deletion lib/soap/response/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ defmodule Soap.Response.Parser do
}
@doc """
Executing with xml response body.
If a list is empty then parse/1 returns full parsed response structure into map.
If a list is empty then `parse/1` returns full parsed response structure into map.
"""
@spec parse(String.t(), integer()) :: map()
def parse(xml_response, :fault) do
Expand Down

0 comments on commit 423efd3

Please sign in to comment.