0

我正在使用 savonrb 作为 SOAP 客户端来发出 api 请求来回显以生成小部件。
似乎 savon 只用最后一个的值覆盖了我的 mergeField,而不是将它们作为数组传递。

我用来进行 api 调用的参数:

call_api(:create_personal_embedded_widget, senderInfo: {email: sender_email}, widgetInfo: {
 "callbackInfo" => {
   "signedDocumentUrl" => signed_document_url
 },  
 "fileInfos" => {
   "FileInfo" => {
     "file" =>encoded_file,
     "fileName" =>"simple_text.docx",
     "mimeType "=>"application/msword"
   }  
 },  
 "formFieldLayerTemplates" => "",
 "locale" => "",
 "mergeFieldInfo" => {
   "mergeFields" => {
     "MergeField" => 
     {
       "defaultValue" => "Foo Bar",
       "fieldName" => "fullName"
     },  
     "MergeField" => 
     {
       "defaultValue" => "01-01-1980",
       "fieldName" => "dob"
     }
   }  
 },  
 "name" => document_name,
 "securityOptions" => "",
 "signatureFlow" =>"SENDER_SIGNS_LAST",
 "widgetAuthFailureInfo" => {
   "deframe" =>"true",
   "delay" =>"10",
   "url" => error_call_back_url
 },  
 "widgetCompletionInfo" => {
   "deframe" =>"true",
   "delay" =>"10",
   "url" => success_call_back_url
 }  
}, personalizationInfo: "")  

实际传递给 echosign 的内容:

<ins2:mergeFieldInfo>
  <ins3:mergeFields>
    <ins3:MergeField>
      <ins3:defaultValue>01-01-1980</ins3:defaultValue>
      <ins3:fieldName>dob</ins3:fieldName>
    </ins3:MergeField>
  </ins3:mergeFields>
</ins2:mergeFieldInfo>

我一直在用这个无济于事,我知道它会覆盖这些值,但不明白为什么,并且不知道如何索引它们以便这些字段是增量的。

提前致谢!

4

1 回答 1

0

似乎不是肥皂或 savon 的问题,是我没有正确创建数组,

mergeFields = { 'MergeField' => [ 
    {'defaultValue' => 'Foo Bar', 'fieldName' => 'fullName' }, 
    {'defaultValue' => '212-555-1234',   'fieldName' => 'phoneNumber },
  ] 
}

在它自己的哈希里面,我只是把变量

"mergeFieldInfo" => {
    "mergeFields" => mergeFields
},
于 2014-06-16T12:26:00.847 回答