XMLRPC serialization bug?

serializes the name / value parts of a struct in the wrong order?

If I do a calll as below

templatevalues = [:name=>"code",:value=>"thecode"},{:name=>"name",
:value=>"the name" }]

result =
server.call("OrangeAPI.SendSmsTemplate",{:username=>"",:password=>"",:"remote-ip"=>""},
{
           :templateValues => templatevalues
})

BUG?: it always produces after serialization - with the value first,
rather than the name

<member><name>templateValues</name>
<value>
  <array>
    <data>
      <value>
        <struct>
          <member>
            <name>value</name>
            <value><string>the code</string></value>
          </member>

          <member>
            <name>name</name>
            <value><string>code</string></value>
          </member>
        </struct>
      </value>

      <value>
        <struct>
          <member>
            <name>value</name>
            <value><string>the name</string></value>
          </member>
          <member>
            <name>name</name>
            <value><string>name</string></value>
          </member>
        </struct>
      </value>
    </data>
  </array>
</value>
</member>

I know you're not supposed to assume any order in XML but is there any
way around this?

Andrew

···

--
Posted via http://www.ruby-forum.com/.

You probably know that Ruby's Hash is unordered.

···

On 8/21/06, Andrew Knott <aknott@mac.com> wrote:

serializes the name / value parts of a struct in the wrong order?

If I do a calll as below

templatevalues = [:name=>"code",:value=>"thecode"},{:name=>"name",
:value=>"the name" }]

result =
server.call("OrangeAPI.SendSmsTemplate
",{:username=>"",:password=>"",:"remote-ip"=>""},
{
           :templateValues => templatevalues
})

BUG?: it always produces after serialization - with the value first,
rather than the name

<member><name>templateValues</name>
<value>
        <array>
                <data>
                        <value>
                                <struct>
                                        <member>
                                                <name>value</name>
                                                <value><string>the
code</string></value>
                                        </member>

                                        <member>
                                                <name>name</name>

                                                <value><string>code</string></value>
                                        </member>
                                </struct>
                        </value>

                        <value>
                                <struct>
                                        <member>
                                                <name>value</name>
                                                <value><string>the
name</string></value>
                                        </member>
                                        <member>
                                                <name>name</name>

                                                <value><string>name</string></value>
                                        </member>
                                </struct>
                        </value>
                </data>
        </array>
</value>
</member>

I know you're not supposed to assume any order in XML but is there any
way around this?

Andrew

--
Posted via http://www.ruby-forum.com/.

--
Kent
---
http://www.datanoise.com