【发布时间】:2013-06-18 15:23:01
【问题描述】:
我正在尝试发出肥皂请求,但是当我使用 operation.body 方法时,operation.build 之后的每个数组似乎都不在 xml 中。
这是 WSDL 的一部分:
<xs:element name="Item" type="ns1:TList_Item"/>
--
<xs:complexType name="TList_Item">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence/>
<xs:attribute xmlns:n1="http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType" n1:arrayType="ns1:TItem[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
--
<xs:complexType name="TItem">
<xs:sequence>
<xs:element name="Item_Name" type="xs:string"/>
<xs:element name="Item_Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
我试过了:
operation.body = { Item: [item1,item2,..] }
但出现此错误:
ArgumentError: Expected a Hash for the :Item complex type
我也试过这个:
How to pass Array as parameter to SOAP in Ruby
没有错误,但在operation.build 之后内容从未进入xml。
我应该如何处理这个问题?
【问题讨论】: