Ruby Savon:从请求中删除 Soap 操作
我正在使用 Savon::Model 来发送 SOAP 请求。
我需要的最终结果如下所示:
<env:Body>
<ins0:ValidateCityPostalCodeZipRequest>
<ins0:Addresses>
<ins0:ShortAddress>
<ins0:City>Toronto</v1:City>
<ins0:Province>ON</v1:Province>
<ins0:Country>CA</v1:Country>
<ins0:PostalCode>L4Y1K7</v1:PostalCode>
</ins0:ShortAddress>
</ins0:Addresses>
</ins0:ValidateCityPostalCodeZipRequest>
</env:Body>
我的 WSDL 仅包含名为:ValidateCityPostalCodeZip 的操作,并接受 ValidateCityPostalCodeZipRequest 对象类型作为参数。
当我尝试发送像代码这样的请求时:
validate_city_postal_code_zip do
soap.header = {
"ins0:RequestContext" => {
"ins0:Version" => "1.0",
"ins0:Language" => "en",
"ins0:GroupID" => "11",
"ins0:RequestReference" => "UserRef"
}
}
soap.body = {
"ins0:Addresses" => {
"ins0:ShortAddress" => {
"ins0:City" => city,
"ins0:Province" => province,
"ins0:Country" => country,
"ins0:PostalCode" => postal_code
}
}
}
end
我获得的格式化 SOAP 查询是
<env:Body>
<wsdl:ValidateCityPostalCodeZip>
<ins0:Addresses>
<ins0:ShortAddress>
<ins0:City>te</ins0:City>
<ins0:Province>te</ins0:Province>
<ins0:Country>te</ins0:Country>
<ins0:PostalCode>te</ins0:PostalCode>
</ins0:ShortAddress>
</ins0:Addresses>
</wsdl:ValidateCityPostalCodeZip>
</env:Body>
Which 导致调用者发生错误,这里是返回消息的摘录:
SOAP response (status 200):
[...]
<Errors>
<Error>
<Code>3001116</Code>
<Description>Service Failed</Description>
<AdditionalInformation i:nil="true"/>
</Error>
</Errors>
How can it be possible to edit the name of the operation?
谢谢
I'm using Savon::Model in order to send a SOAP request.
The final result I need look like this:
<env:Body>
<ins0:ValidateCityPostalCodeZipRequest>
<ins0:Addresses>
<ins0:ShortAddress>
<ins0:City>Toronto</v1:City>
<ins0:Province>ON</v1:Province>
<ins0:Country>CA</v1:Country>
<ins0:PostalCode>L4Y1K7</v1:PostalCode>
</ins0:ShortAddress>
</ins0:Addresses>
</ins0:ValidateCityPostalCodeZipRequest>
</env:Body>
My WSDL only contains the operation named: ValidateCityPostalCodeZip and accepts as parameter a ValidateCityPostalCodeZipRequest object type.
When I'm trying to send the Request like the code:
validate_city_postal_code_zip do
soap.header = {
"ins0:RequestContext" => {
"ins0:Version" => "1.0",
"ins0:Language" => "en",
"ins0:GroupID" => "11",
"ins0:RequestReference" => "UserRef"
}
}
soap.body = {
"ins0:Addresses" => {
"ins0:ShortAddress" => {
"ins0:City" => city,
"ins0:Province" => province,
"ins0:Country" => country,
"ins0:PostalCode" => postal_code
}
}
}
end
The formatted SOAP query I obtain is
<env:Body>
<wsdl:ValidateCityPostalCodeZip>
<ins0:Addresses>
<ins0:ShortAddress>
<ins0:City>te</ins0:City>
<ins0:Province>te</ins0:Province>
<ins0:Country>te</ins0:Country>
<ins0:PostalCode>te</ins0:PostalCode>
</ins0:ShortAddress>
</ins0:Addresses>
</wsdl:ValidateCityPostalCodeZip>
</env:Body>
Which causing an error from the caller, here's an excerpt from the returned message:
SOAP response (status 200):
[...]
<Errors>
<Error>
<Code>3001116</Code>
<Description>Service Failed</Description>
<AdditionalInformation i:nil="true"/>
</Error>
</Errors>
How can it be possible to modify the name of the operation ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论