2

When supplying savon with:

hash = { 
              "Objects" => { //stuff here }, 
           :attributes! => { "Objects" => {"xsi:type" => "Something"}}
       }

I get:

<Objects>...</Objects>

When supplying savon with anything else i get the expected result:

hash = { 
         "foo" => { //stuff here }, 
         :attributes! => { "foo" => {"xsi:type" => "Something"}}
       }

I get:

<foo xsi:type="Something"></foo>

I must use the string "Objects" as the key. I am coding to a 3rd party SOAP web service. I cannot use a symbol because the first letter would become a lower cap.

thanks,

1 Answer 1

0

You have to change :attributes! to :@xsi:type=>"Something" within the hash where you want the attribute

Like:

"foo"=>{:@xsi:type=>'something', //stuff here}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.