与损坏请求相关的 Savon 问题

发布于 2024-11-29 06:10:31 字数 2057 浏览 0 评论 0原文

我将 Savon 版本更新到 0.9.6,但我的服务器请求似乎格式错误。在更新之前,我使用的是Savon 0.9.2。

我有一个与下面的帖子中提到的类似的问题,但是,它的不同之处在于重复的项目包括完整的对象。我尝试过使用数组,但没有成功。 Savon:如何在 SOAP 请求的哈希主体中指定自定义 XML?

请求是这样构建的:

#Address object
address =  {
      'AddressCode' => 'Dest',
      'Line1' => '1234 Anywhere Street',
      'City' => 'Anywhere',
      'Region' => 'Somewhere',
      'PostalCode' => '12345',
      'Country' => 'USA'
          }
#Building the request
request = {"Request" => {
      'CompanyCode' => 'DEFAULT',
      'DocType' => 'Word',
      'Addresses' => {'BaseAddress' => [address]}
          }}

0.9.6(损坏的)请求部分

   <ser:Request>
            <ser:CompanyCode>DEFAULT</ser:CompanyCode>
            <ser:DocType>Word</ser:DocType>            
            <ser:Addresses>
               <ins0:Addresses>
               <ins0:BaseAddress>AddressCodeDestLine11234 Anywhere StreetCityAnywhere RegionSomewherePostalCode12345CountryUS</ins0:BaseAddress>
            </ser:Addresses>           
         </ser:Request>

0.9.2(工作)请求部分

<ser:Request>
    <ser:CompanyCode>DEFAULT</ser:CompanyCode>
    <ser:DocType>Word</ser:DocType>            
    <ser:Addresses>
       <ser:BaseAddress>
          <ser:AddressCode>Dest</ser:AddressCode>
          <ser:Line1>1234 Anywhere Street</ser:Line1>
          <ser:City>Anywhere</ser:City>
          <ser:Region>Somewhere</ser:Region>
          <ser:PostalCode>12345</ser:PostalCode>
          <ser:Country>US</ser:Country>
       </ser:BaseAddress>
    </ser:Addresses>           
 </ser:Request>

有人有什么想法吗? 我非常感谢您愿意提供的任何建议。

谢谢你!

I updated my Savon version to 0.9.6 and my server requests seem to be malforming. Before the update, I was using Savon 0.9.2.

I have a similar problem as someone mentioned in the post below, however, it differs in that the repeated items include full objects. I've tried using arrays, with no luck.
Savon: How can I specify a custom XML in a hash body for a SOAP request?

The requests are built this way:

#Address object
address =  {
      'AddressCode' => 'Dest',
      'Line1' => '1234 Anywhere Street',
      'City' => 'Anywhere',
      'Region' => 'Somewhere',
      'PostalCode' => '12345',
      'Country' => 'USA'
          }
#Building the request
request = {"Request" => {
      'CompanyCode' => 'DEFAULT',
      'DocType' => 'Word',
      'Addresses' => {'BaseAddress' => [address]}
          }}

0.9.6 (Broken) Request portion

   <ser:Request>
            <ser:CompanyCode>DEFAULT</ser:CompanyCode>
            <ser:DocType>Word</ser:DocType>            
            <ser:Addresses>
               <ins0:Addresses>
               <ins0:BaseAddress>AddressCodeDestLine11234 Anywhere StreetCityAnywhere RegionSomewherePostalCode12345CountryUS</ins0:BaseAddress>
            </ser:Addresses>           
         </ser:Request>

0.9.2 (Working) Request portion

<ser:Request>
    <ser:CompanyCode>DEFAULT</ser:CompanyCode>
    <ser:DocType>Word</ser:DocType>            
    <ser:Addresses>
       <ser:BaseAddress>
          <ser:AddressCode>Dest</ser:AddressCode>
          <ser:Line1>1234 Anywhere Street</ser:Line1>
          <ser:City>Anywhere</ser:City>
          <ser:Region>Somewhere</ser:Region>
          <ser:PostalCode>12345</ser:PostalCode>
          <ser:Country>US</ser:Country>
       </ser:BaseAddress>
    </ser:Addresses>           
 </ser:Request>

Does anyone have any ideas?
I would really appreciate any advice you are willing to offer.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文