Savon:如何在正文中添加容器标签

Savon: how to add container tag within body

我想使用的 Web 服务需要一个外部标签来保存所有正文标签。

像这样:

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.api.web.cg.igfs.xxx">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:Init>
         <request>
            <tid>SOME_ID</tid>

如何添加封闭的 request 标签?

在 Savon 中,client.call(:init, message: { tid: 'SOME_ID', .. }) 生成:

   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.api.web.cg.igfs.xxx">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:Init>
        <tid>SOME_ID</tid>

您应该可以将它添加到您的散列顶部

client.call(:init, message: { request: { tid: 'SOME_ID', .. }})