Castile v1.0.0 Castile View Source
Documentation for Castile.
Link to this section Summary
Functions
Calls a SOAP service operation
Same as call/4, but raises an exception instead
Converts an operation’s parameters into XML
Initializes a service model from a WSDL file. This parses the WSDL and it’s imports recursively, building an internal model of all the XSD types and SOAP metadata for later use
Link to this section Functions
Calls a SOAP service operation.
Examples
iex> Castile.call(model, :CountryISOCode, %{sCountryName: "Netherlands"})
{:ok, "NL"}
Same as call/4, but raises an exception instead.
Link to this function
convert(model, type, params)
View Source
convert(Castile.Model.t(), operation :: atom(), params :: map()) :: {:ok, binary()} | {:error, term()}
Converts an operation’s parameters into XML.
Examples
iex> Castile.call(model, :CountryISOCode, %{sCountryName: "Netherlands"})
{:ok, "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><CountryISOCode xmlns="http://www.oorsprong.org/websamples.countryinfo"><sCountryName>Netherlands</sCountryName></CountryISOCode></soap:Body></soap:Envelope>"}
Link to this function
init_model(wsdl_file, namespaces \\ [])
View Source
init_model(Path.t(), namespaces :: list()) :: Castile.Model.t()
Initializes a service model from a WSDL file. This parses the WSDL and it’s imports recursively, building an internal model of all the XSD types and SOAP metadata for later use.
Similar to Elixir’s pre-compiled Regexes, it’s recommended to do this at compile-time in an @attribute.
Examples
iex> model = Castile.init_model("CountryInfoService.wsdl")
%Castile.Model{...}