将属性添加到xml请求

时间:2017-11-14 14:28:06

标签: ruby xml savon

我正在使用Savon Ruby gem来调用SOAP API,我的请求几乎已经准备就绪,但有一件事情仍然存在。

savonclient = Savon.client(wsdl: 'test.wsdl',
endpoint: 'http://endpoint.biz/',
                  log: true,
                  log_level: :debug,
                  pretty_print_xml: true,
                  convert_request_keys_to: :none,
                  namespaces: { 'xmlns:buggy' => 'http://otherdomain.biz/something.xsd'},
                  soap_header: { 'buggy:client' => {
"id:property1" => 'value1',
"id:property2" => 'value2'
}

这会产生

<env:Header>
<buggy:client>
  <id:property1>value1</id:property1>
  <id:propert2>value2</id:property2>
</buggy:client>

我需要的是在马车之后拥有财产:客户,像这样:

<buggy:client id:objecttype="something">

我尝试为soap_header添加属性哈希,但它只在下面创建一个新属性。

有什么想法吗?

0 个答案:

没有答案