Last Updated: February 25, 2016
· dcdieci

How to consume API with ruby

Recently I had to access the xml webservice of which caused a lot of headache due to a very few documentation docs.

So first of all it was hard to find a documentation about the service itself. Here it is.

In order to the the spec of the service you might wanna take a look at a wsdl viewer:

Since I did not want to come up with a self written api consumer it decided to to ahead by using the savon gem (Version 2) .

Here is my constructor to get the client running

 @client = Savon.client(
   wsdl: "",
   endpoint: "",
   namespace_identifier: :v2,
   env_namespace: :soapenv,
   pretty_print_xml: true  ,
   log_level: :debug ,
   log:                     true,


will give you an overview of the available methods.

since the child elements in the soap envelope body do not inherit the namespace identifier you might want to use nil

namespace_identifier: nil