I use Savon with SOAP requests. I try to send structure below with USD currency:
'urn2:Amt' => {
'urn2:InstdAmt Ccy="USD"' => 1.00
},
Unfortunately SAVON misinterprets this and send something like this
<urn2:Amt><urn2:InstdAmt Ccy="USD">1.0</urn2:InstdAmt>Ccy="USD"></urn2:Amt>
I'm making a mistake somewhere, the correct structure should look like this:
<urn2:Amt>
<urn2:InstdAmt Ccy="USD">1.00</urn2:InstdAmt>
</urn2:Amt>
Can you give me a hint?
Savon uses
gyokufor xml generation so you can leverage that syntax to generate the xml you are looking for.Per Explicit XML Attributes in the docs:
So in your example
This will generate the following xml: