【问题标题】:Ruby on Rails Adobe EchoSign SOAP RequestRuby on Rails Adob​​e EchoSign SOAP 请求
【发布时间】:2013-09-09 16:05:58
【问题描述】:

我正在尝试使用 Ruby on Rails 创建对 EchoSign API 的 SOAP 请求,但我收到一条错误消息,提示其中一个字段为空白:

{http://dto14.api.echosign}RecipientRole: cannot accept ''

这是我正在使用的代码:

require 'soap/wsdlDriver'
require 'base64'

filename = 'quote'
recipient = 'martin@domain.co.uk'
quote_id = params[:id]

$S = SOAP::WSDLDriverFactory.new("https://secure.echosign.com/services/EchoSignDocumentService16?wsdl").create_rpc_driver

r = $S.sendDocument(
  :apiKey => 'XXXXXXXXXXX',
  :senderInfo => SOAP::SOAPNil.new,         # we need to explicitly set elements to nil
  :documentCreationInfo => {
          :fileInfos  => [{
                  :file      => RAILS_ROOT + '/pdfs/' + quote_id + '.pdf',
                  :fileName  => filename,
          }],
          :recipients => 
                  [{ :RecipientInfo => [{
                                :email     => 'martin@domain.co.uk',
                                :fax       => SOAP::SOAPNil.new,
                                :role      => 'SIGNER' 
                  }]
          }],
          :message  => "This is neat.",
          :name     => "Test from SOAP-Lite: " + filename,
          :reminderFrequency => "WEEKLY_UNTIL_SIGNED",
          :signatureFlow => "SENDER_SIGNATURE_NOT_REQUIRED",
          :signatureType => "ESIGN",
          :callbackInfo => SOAP::SOAPNil.new,     # we need to explicitly set elements to nil
          :ccs => SOAP::SOAPNil.new,        # we need to explicitly set elements to nil
          :externalId => SOAP::SOAPNil.new,       # we need to explicitly set elements to nil
          :securityOptions => SOAP::SOAPNil.new,      # we need to explicitly set elements to nil
  }
)

我这样做的方式显然有问题

:recipients => 
              [{ :RecipientInfo => [{
                            :email     => 'martin@domain.co.uk',
                            :fax       => SOAP::SOAPNil.new,
                            :role      => 'SIGNER' 
              }]
}],

但我发现仅从文档中找到内容非常困难,我认为这会很愚蠢但无法发现。

更新

在仔细查看example request 之后,我尝试了以下方法,但没有任何区别:

require 'soap/wsdlDriver'
require 'base64'

filename = 'quote'
quote_id = params[:id]

$S = SOAP::WSDLDriverFactory.new("https://secure.echosign.com/services/EchoSignDocumentService16?wsdl").create_rpc_driver

r = $S.sendDocument(
  :apiKey => 'XXXXXXXXXXX',
  :senderInfo => SOAP::SOAPNil.new,      
  :documentCreationInfo => {
          :fileInfos  => {
                  :FileInfo => {
                                :file      => RAILS_ROOT + '/pdfs/' + quote_id + '.pdf',
                                :fileName  => filename
                  }
          },
          :recipients => { 
                  :RecipientInfo => {
                                :email     => 'martin@domain.co.uk',
                                :fax       =>  SOAP::SOAPNil.new, 
                                :role      =>  'SIGNER'
                  }
          },
          :mergeFieldInfo => SOAP::SOAPNil.new,
          :tos => SOAP::SOAPNil.new,
          :message  => "This is neat.",
          :name     => "Test from SOAP-Lite: " + filename,
          :reminderFrequency => "WEEKLY_UNTIL_SIGNED",
          :signatureFlow => "SENDER_SIGNATURE_NOT_REQUIRED",
          :signatureType => "ESIGN",
          :callbackInfo => SOAP::SOAPNil.new,     # we need to explicitly set elements to nil
          :ccs => SOAP::SOAPNil.new,        # we need to explicitly set elements to nil
          :externalId => SOAP::SOAPNil.new,       # we need to explicitly set elements to nil
          :securityOptions => SOAP::SOAPNil.new     # we need to explicitly set elements to nil
  }
)

【问题讨论】:

    标签: ruby-on-rails ruby soap ruby-on-rails-2 echosign


    【解决方案1】:

    您能否尝试使用"SIGNER" 之类的双引号传递值SIGNER。就像 "ESIGN" 和其他一些参数一样。

    另外,如果发送 ESIGNFax 不需要是 nil。尽量不要定义:Fax

    【讨论】:

      【解决方案2】:

      您应该将电子邮件地址和角色更改为使用双引号而不是单引号。

                    :RecipientInfo => {
                                  :email     => "martin@domain.co.uk",
                                  :fax       =>  SOAP::SOAPNil.new, 
                                  :role      =>  "SIGNER" change 
      

      和你做的一样 :reminderFrequency => "WEEKLY_UNTIL_SIGNED", :signatureFlow => "SENDER_SIGNATURE_NOT_REQUIRED",

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多