Savon: Use complex SOAP types as arguments

Updated . Posted . Visible to the public.

If a SOAP API expects you to call a remote method with arguments of complex types, Savon Show archive.org snapshot lets you manually set the xsi:type attribute like this:

client.call(:rpc_method,
  message: {
    :some_object => {
      :name => 'foo',
      :other => 'bar',
      '@xsi:type' => 'somenamespace:SomeObject'
    }
  }
)

This is roughly equivalent to this in Javaland, where you have magic generated stub code:

SomeObject so = new SomeObject();
so.setName('foo');
so.setOther('bar');
client.rpcMethod(so);
Henning Koch
Last edit
Henning Koch
Keywords
ruby, parameters, wsdl, web, services, api
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2015-07-09 20:38)