2013-09-26 93 views
1

我在正確理解DocuSign API時遇到了一些麻煩。DocuSign創建併發送信封未指定錯誤

我的第一個任務是簡單地發送和創建一個信封。我使用UIView和Core Graphics創建了一個PDF(在iOS中)。然後,我繼續將Anchor標籤放在需要簽名的部分。

由於創建了Anchor選項卡,我不確定是否應該將我的選項卡作爲輸出的一部分發送。

這裏是我的輸出身體

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:DSAPIService="http://www.docusign.net/API/3.0" xsl:version="1.0"> 
    <soap:Body> 
    <DSAPIService:CreateAndSendEnvelope> 
     <DSAPIService:Envelope> 
     <DSAPIService:AccountId>(Account Id)</DSAPIService:AccountId> 
     <DSAPIService:Documents> 
      <DSAPIService:Document> 
      <DSAPIService:ID>1</DSAPIService:ID> 
      <DSAPIService:Name>(Name)</DSAPIService:Name> 
      <DSAPIService:PDFBytes>(PDF data)</DSAPIService:PDFBytes> 
      </DSAPIService:Document> 
     </DSAPIService:Documents> 
     <DSAPIService:Recipients> 
      <DSAPIService:Recipient> 
      <DSAPIService:ID>1</DSAPIService:ID> 
      <DSAPIService:UserName>(Signer 1)</DSAPIService:UserName> 
      <DSAPIService:Email>(Signer 1 email)</DSAPIService:Email> 
      <DSAPIService:Type>Signer</DSAPIService:Type> 
      <DSAPIService:RoutingOrder>0</DSAPIService:RoutingOrder> 
      </DSAPIService:Recipient> 
      <DSAPIService:Recipient> 
      <DSAPIService:ID>2</DSAPIService:ID> 
      <DSAPIService:UserName>(Signer 2)</DSAPIService:UserName> 
      <DSAPIService:Email>(Signer 2 Email)/DSAPIService:Email> 
      <DSAPIService:Type>Signer</DSAPIService:Type> 
      <DSAPIService:RoutingOrder>1</DSAPIService:RoutingOrder> 
      </DSAPIService:Recipient> 
      <DSAPIService:Recipient> 
      <DSAPIService:ID>3</DSAPIService:ID> 
      <DSAPIService:UserName>(Signer 3)</DSAPIService:UserName> 
      <DSAPIService:Email>(Signer 3 email)</DSAPIService:Email> 
      <DSAPIService:Type>InPersonSigner</DSAPIService:Type> 
      <DSAPIService:CaptiveInfo/> 
      <DSAPIService:RoutingOrder>2</DSAPIService:RoutingOrder> 
      </DSAPIService:Recipient> 
      <DSAPIService:Recipient> 
      <DSAPIService:ID>4</DSAPIService:ID> 
      <DSAPIService:UserName>(Signer 4)</DSAPIService:UserName> 
      <DSAPIService:Email>(Signer 4 email)</DSAPIService:Email> 
      <DSAPIService:Type>Signer</DSAPIService:Type> 
      <DSAPIService:RoutingOrder>3</DSAPIService:RoutingOrder> 
      </DSAPIService:Recipient> 
     </DSAPIService:Recipients> 
     <DSAPIService:Tabs/> 
     <DSAPIService:Subject>(Subject)</DSAPIService:Subject> 
     <DSAPIService:EmailBlurb>Please sign the attached document.</DSAPIService:EmailBlurb> 
     <DSAPIService:EnableWetSign>true</DSAPIService:EnableWetSign> 
     </DSAPIService:Envelope> 
    </DSAPIService:CreateAndSendEnvelope> 
    </soap:Body> 
</soap:Envelope> 

這裏是我的迴應

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:9a22096c-ca51-4445-80fd-78c08f9b0f24</wsa:MessageID><wsa:RelatesTo>urn:uuid:7f921133-4834-402b-aaa7-769b7fa0042b</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-9b102c34-6215-4fd6-8f9c-f1cb6a30c080"><wsu:Created>2013-09-26T22:59:09Z</wsu:Created><wsu:Expires>2013-09-26T23:04:09Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Unspecified_Error</faultstring><faultactor>https://www.docusign.net/api/3.0/DSAPI.asmx</faultactor><detail><ErrorCode xmlns="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config">An Error Occurred.</ErrorReason></detail></soap:Fault></soap:Body></soap:Envelope> 
namespace error : xmlns: 'missing in Web.Config' is not a valid URI 
/api/3.0/DSAPI.asmx</faultactor><detail><ErrorCode xmlns="missing in Web.Config" 
                      ^
namespace error : xmlns: 'missing in Web.Config' is not a valid URI 
="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config" 
                      ^
2013-09-26 15:59:09.107 (iOS App Name)[89329:4003] DSAPIService_CreateAndSendEnvelope soap call failed: 

************ 
Unspecified_Error 
************ 

我通過該服務相當徹底的文檔看了,但我真的不確定錨接片如何自動適應,如果他們適合於API。

即使我試圖通過將我想用作/ s1/s2 /等所有我的字段來嘗試使用自動錨選項卡,我還是要添加選項卡嗎?我看不到任何其他問題爲什麼通話失敗。

編輯:我現在看到我需要添加選項卡,無論自動錨定。我將如何添加簽名自動錨定簽名,日期和標題?

回答

1

首先,我建議您爲文檔指定FileExtension。 (正如我在下面提供的示例中所做的那樣)。

其次,絕對在1(不爲零)時啓動RoutingOrder。這可能是你得到錯誤的原因。

最後,下面的SOAP的XML的示例使用在文檔內的錨文本以放置/如下指定選項卡:

  • 放入信封用於第一簽名者SignHere標籤(RecipientId = 1)的任何地方出現文本\ s1 \。的任何地方,所述文本\ D1 \出現
  • 地點DateSigned標籤在信封用於第一簽名者 (RecipientId = 1)。
  • 地點標題標籤在信封用於第一簽名者 (RecipientId = 1),所述文本\ T1 \出現的任何地方。

  • 地點SignHere標籤在信封用於第二簽名人(RecipientId = 2)的任何地方,所述文本\ S2 \出現。

  • 地點DateSigned標籤在信封用於第二簽名者 (RecipientId = 2),所述文本\ D2 \出現的任何地方。
  • 地點標題標籤在信封中爲第二個(RecipientId = 2)任何文字\ t2 \出現。

       <ns:Tab> 
            <ns:RecipientID>2</ns:RecipientID> 
            <ns:AnchorTabItem> 
             <ns:AnchorTabString>\t2\</ns:AnchorTabString> 
            </ns:AnchorTabItem> 
            <ns:Type>Title</ns:Type> 
           </ns:Tab> 
    

    可選地,可以指定偏移如果必要的話,用於相對於更精確的標籤放置測量:

    <ns:CreateAndSendEnvelope> 
        <ns:Envelope> 
         <ns:AccountId>my_account_id</ns:AccountId> 
         <ns:Documents> 
          <ns:Document> 
           <ns:ID>1</ns:ID> 
           <ns:Name>Simple NDA.pdf</ns:Name> 
           <ns:PDFBytes>bytes_removed</ns:PDFBytes> 
           <ns:FileExtension>pdf</ns:FileExtension> 
           <ns:AttachmentDescription>Simple NDA</ns:AttachmentDescription> 
          </ns:Document> 
         </ns:Documents> 
         <ns:Recipients> 
          <ns:Recipient> 
           <ns:ID>1</ns:ID> 
           <ns:UserName>Betty Adams</ns:UserName> 
           <ns:Email>[email protected]</ns:Email> 
           <ns:Type>Signer</ns:Type> 
           <ns:RoutingOrder>1</ns:RoutingOrder> 
          </ns:Recipient> 
          <ns:Recipient> 
           <ns:ID>2</ns:ID> 
           <ns:UserName>John Jones</ns:UserName> 
           <ns:Email>[email protected]</ns:Email> 
           <ns:Type>Signer</ns:Type> 
           <ns:RoutingOrder>2</ns:RoutingOrder> 
          </ns:Recipient> 
         </ns:Recipients> 
         <ns:Tabs> 
          <ns:Tab> 
           <ns:RecipientID>1</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\s1\</ns:AnchorTabString> 
            <ns:XOffset>-7</ns:XOffset> 
            <ns:YOffset>12</ns:YOffset> 
            <ns:Unit>Pixels</ns:Unit> 
           </ns:AnchorTabItem> 
           <ns:Type>SignHere</ns:Type> 
          </ns:Tab> 
          <ns:Tab> 
           <ns:RecipientID>1</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\d1\</ns:AnchorTabString> 
           </ns:AnchorTabItem> 
           <ns:Type>DateSigned</ns:Type> 
          </ns:Tab> 
          <ns:Tab> 
           <ns:RecipientID>1</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\t1\</ns:AnchorTabString> 
           </ns:AnchorTabItem> 
           <ns:Type>Title</ns:Type> 
          </ns:Tab> 
          <ns:Tab> 
           <ns:RecipientID>2</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\s2\</ns:AnchorTabString> 
           </ns:AnchorTabItem> 
           <ns:Type>SignHere</ns:Type> 
          </ns:Tab> 
          <ns:Tab> 
           <ns:RecipientID>2</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\d2\</ns:AnchorTabString> 
           </ns:AnchorTabItem> 
           <ns:Type>DateSigned</ns:Type> 
          </ns:Tab> 
          <ns:Tab> 
           <ns:RecipientID>2</ns:RecipientID> 
           <ns:AnchorTabItem> 
            <ns:AnchorTabString>\t2\</ns:AnchorTabString> 
           </ns:AnchorTabItem> 
           <ns:Type>Title</ns:Type> 
          </ns:Tab> 
         </ns:Tabs> 
         <ns:Subject>Please DocuSign this document</ns:Subject> 
         <ns:EmailBlurb>Please sign this document using DocuSign...thanks!</ns:EmailBlurb> 
        </ns:Envelope> 
    </ns:CreateAndSendEnvelope> 
    

至少,使用錨文本必須包含以下元素中指定的每個選項卡錨文本字符串的位置,通過使用XOffset,YOffset單元單元作爲代碼示例爲fir st簽名者的簽名標籤:

   <ns:Tab> 
        <ns:RecipientID>1</ns:RecipientID> 
        <ns:AnchorTabItem> 
         <ns:AnchorTabString>\s1\</ns:AnchorTabString> 
         <ns:XOffset>-7</ns:XOffset> 
         <ns:YOffset>12</ns:YOffset> 
         <ns:Unit>Pixels</ns:Unit> 
        </ns:AnchorTabItem> 
        <ns:Type>SignHere</ns:Type> 
       </ns:Tab> 
0

退房的DocuSign的開發人員中心爲您的問題都經過那裏回答:

http://www.docusign.com/developer-center

如果你去探索 - >特點再看看在棒 - ETABS頁面,你會看到標題爲的標籤定位,其描述錨標籤。要回答您的問題,DocuSign的每個選項卡都可以選擇使用絕對定位或相對定位。如果您正在設置選項卡的XPosition和YPosition,那麼您正在使用絕對定位。另一方面,如果您正在使用錨點標記,那麼您正在使用相對定位 - 在這種情況下,您需要使用標籤的錨點設置。在REST它看起來像這樣(我敢肯定,你可以很容易地採用了SOAP):

"tabs": { 
    "signHereTabs": [ 
    { 
    "anchorString": "Please Sign Here:", 
    "anchorXOffset": "1", 
    "anchorYOffset": "0", 
    "anchorIgnoreIfNotPresent": "false", 
    "anchorUnits": "inches" 
    } 
    ] 
} 

基本上,在你的SOAP代碼的標籤元素,你只需要設置anchorString(什麼文件內容標籤將錨定到),偏移量(如果有)以及偏移量單位等。上述示例將在文檔中找到文本「請在此處簽名」的任何位置右側放置簽名選項卡1英寸


就您收到的未指定錯誤而言,我有一種感覺,這是由於您的routingOrder。我不相信0被允許作爲路由命令,而是嘗試從1開始。

相關問題