我正在Ruby 中使用wash_out gem 开发一个SOAP 服务。我有一个肥皂请求,我将在肥皂请求中获得重复的元素(下面给出的请求中的唯一 ID)。但是我找不到在 args 参数中定义这些元素的方法。
SOAP 请求是:
<OTA_CancelRQ Version="2.1" EchoToken="201403211421"
xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UniqueID ID="859623" Type="501"/>
<UniqueID ID="ABCDEF" Type="502"/>
<UniqueID ID="123456" Type="10"/>
<Reasons>
<Reason>business plan changed</Reason>
</Reasons>
</OTA_CancelRQ>
这是我的冲洗控制器中的代码:
soap_service namespace: 'urn:WashOut'
soap_action "OTA_CancelRQ",
:args => {
:OTA_CancelRQ =>{
:UniqueID => {
:@ID => :integer,
:@Type => :integer
},
:Reasons => [{:Reason => :string }]
}},
:return => :string,
:to => :cancel_booking
这些 args 生成一个只有一个 UniqueId 元素的 WSDL。我曾尝试在 args 中多次定义 UniqueId,但它只生成一个 UniqueId 元素。