Ruby on rails 3 改变Savon';当WSDL需要(complexType-sequence)包含多个元素时,将输出

Ruby on rails 3 改变Savon';当WSDL需要(complexType-sequence)包含多个元素时,将输出,ruby-on-rails-3,soap,wsdl,savon,Ruby On Rails 3,Soap,Wsdl,Savon,我正在尝试使用Savon访问一个带有WSDL的SOAP API 在WSDL中,它定义了一个complexType,如下所示: <s:complexType name="UserAdd"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" nillable="true" name="user_location" type="s:string"/> <s:element minOccu

我正在尝试使用Savon访问一个带有WSDL的SOAP API

在WSDL中,它定义了一个complexType,如下所示:

<s:complexType name="UserAdd">
  <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" nillable="true" name="user_location" type="s:string"/>
    <s:element minOccurs="1" maxOccurs="1" nillable="true" name="number" type="s:string"/>
    <s:element minOccurs="1" maxOccurs="1" nillable="true" name="user_table" type="s:string"/>
  </s:sequence>
</s:complexType>
hash_of_vars = {user_location: here, number: 1234549789, user_table: there}
response = @@call_client.call(:user_add, message: {data: hash_of_vars})
Savon生成的XML如下所示:

<data><user_location>here</user_location><number>1234549789</number><user_table>there</user_table></data>

有没有办法让Savon遵守WSDL并以服务器期望的格式输出请求,而不创建明确定义所有项/键/值关系的散列?

标准问题:您是否尝试过使用SoapUI的接口?成功的SOAP消息看起来如何?以您的方式返回到创建此消息的Savon代码。我没有从SoapUI中执行此操作,但是我从发出此请求的PHP应用程序中获得了一个数据包转储,并且成功了。我刚刚给出并构建了一个添加了属性的哈希嵌套数组,现在正在使用它。
<data><user_location>here</user_location><number>1234549789</number><user_table>there</user_table></data>
Cannot use object of type stdClass as array