2017-01-26 7 views
0

私はDocusignとインパルス署名者を使用して埋め込み署名します。私の.Netウェブサイトはログインしてdocusignテンプレートを開き、残りのapiを介してdocusignドキュメントのタグに値を渡すことができるはずです。しかし、残りのapiを介して "フルネーム"と "会社"ポピュレートされていません。テンプレートのロール名の名前は「Signer1」であり、またそれは、フリーフォームの署名を示しているaction.Checkとしてロール名Docusign apiはインサイド署名者として署名を埋め込んでいます - C#app - タグは残りのapiによって渡された値を設定せず、ドキュメントは自由形式の署名になります

のためのスクリーンショットのために、このパスを「人ログイン」を使用します。ドキュメントの左側に「FIELDS」があり、フォーム上にドラッグ&ドロップする必要があります(これらのフィールドに値が設定されています)。

しかし、私は左のフリーフォームフィールドを見たくありません。 私は、inperson署名者のためにタグ値を文書に渡したいだけで、文書に表示する必要があります。

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Collections; 
using System.Web; 
using System.Web.UI; 
using System.IO; 
using System.Net; 
using System.Xml; 
using System.Text; 
using RestSharp; 
using Newtonsoft.Json; 
using System.Web.UI.WebControls; 
using System.Collections.Specialized; 
using log4net; 
using DocuSign.eSign.Api; 
using DocuSign.eSign.Model; 
using DocuSign.eSign.Client; 

namespace TestProject 
{ 
    public partial class Home : System.Web.UI.Page 
    { 
     protected void getDocusign() 
     { 
      string username = "****"; 
      string password = "****"; 
      string integratorKey = "****************************"; 
      string templateId = "*******************************";   
      string roleName = "Signer1"; 



      string url = "https://demo.docusign.net/restapi/v2/login_information"; 
      string baseURL = ""; // we will retrieve this 
      string accountId = ""; // will retrieve 
      string envelopeId = ""; // will retrieve 
      string uri = ""; // will retrieve 
      try 
      { 
       string authenticateStr = 
        "<DocuSignCredentials>" + 
         "<Username>" + username + "</Username>" + 
         "<Password>" + password + "</Password>" + 
         "<IntegratorKey>" + integratorKey + "</IntegratorKey>" + 
         "</DocuSignCredentials>"; 
       // 
       // STEP 1 - Login 
       // 
       HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); 
       request.Headers.Add("X-DocuSign-Authentication", authenticateStr); 
       request.Accept = "application/xml"; 
       request.Method = "GET"; 
       HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse(); 
       StreamReader sr = new StreamReader(webResponse.GetResponseStream()); 
       string responseText = sr.ReadToEnd(); 
       using (XmlReader reader = XmlReader.Create(new StringReader(responseText))) 
       { 
        while (reader.Read()) 
        { // Parse the xml response body 
         if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "accountId")) 
          accountId = reader.ReadString(); 
         if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "baseUrl")) 
          baseURL = reader.ReadString(); 
        } 
       } 
       // 
       // STEP 2 - Request Envelope Result 
       // 
       // Construct an outgoing XML request body 
       string requestBody = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" + 
        "<accountId>" + accountId + "</accountId>" + 
         "<status>sent</status>" + 
         "<emailSubject>Company Notice - Signature Request</emailSubject>" + 
         "<emailBlurb>Testing from Sandy</emailBlurb>" + 
         "<templateId>" + templateId + "</templateId>" + 
         "<templateRoles>" + 
         "<templateRole>" + 
         "<email>" + "[email protected]" + "</email>" + // NOTE: Use different email address if username provided in non-email format! 
         "<name>" + "George Keane" + "</name>" +    // username can be in email format or an actual ID string 
         "<roleName>" + roleName + "</roleName>" + 
         "<clientUserId>9</clientUserId>" + 
         "<tabs>" + 
         "<textTabs>" + 
         "<text>" + 
         "<tabLabel>" + "Full Name" + "</tabLabel>" + 
         "<value>" + "George Keane" + " </value>" + 
         "</text>" + 
         "<text>" + 
         "<tabLabel>" + "Company" + "</tabLabel>" + 
         "<value>" + "Dell" + " </value>" + 
         "</text>" + 
         "</textTabs>" + 
         "</tabs>" + 
         "</templateRole>" + 
         "</templateRoles>" + 
         "</envelopeDefinition>"; 

       // append "/envelopes" to baseUrl and use in the request 
       request = (HttpWebRequest)WebRequest.Create(baseURL + "/envelopes"); 
       request.Headers.Add("X-DocuSign-Authentication", authenticateStr); 
       request.ContentType = "application/xml"; 
       request.Accept = "application/xml"; 
       request.ContentLength = requestBody.Length; 
       request.Method = "POST"; 
       // write the body of the request 
       byte[] body = System.Text.Encoding.UTF8.GetBytes(requestBody); 
       Stream dataStream = request.GetRequestStream(); 
       dataStream.Write(body, 0, requestBody.Length); 
       dataStream.Close(); 
       // read the response 
       webResponse = (HttpWebResponse)request.GetResponse(); 
       sr = new StreamReader(webResponse.GetResponseStream()); 
       responseText = sr.ReadToEnd(); 
       using (XmlReader reader = XmlReader.Create(new StringReader(responseText))) 
       { 
        while (reader.Read()) 
        { // Parse the xml response body 
         if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "envelopeId")) 
          envelopeId = reader.ReadString(); 
         if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "uri")) 
          uri = reader.ReadString(); 
        } 
       } 
       // 
       // STEP 3 - Get the Embedded Console Sign View 
       // 
       // construct another outgoing XML request body 
       string reqBody = "<recipientViewRequest xmlns=\"http://www.docusign.com/restapi\">" + 
        "<authenticationMethod>email</authenticationMethod>" + 
         "<email>" + "[email protected]" + "</email>" + //+ username + // NOTE: Use different email address if username provided in non-email format! 
         "<returnUrl>http://www.docusign.com</returnUrl>" + // username can be in email format or an actual ID string 
         "<clientUserId>9</clientUserId>" + 
         "<userName>" + "George Keane" + "</userName>" + 
         "</recipientViewRequest>"; 

       // append uri + "/views/recipient" to baseUrl and use in the request 
       request = (HttpWebRequest)WebRequest.Create(baseURL + uri + "/views/recipient"); 
       request.Headers.Add("X-DocuSign-Authentication", authenticateStr); 
       request.ContentType = "application/xml"; 
       request.Accept = "application/xml"; 
       request.ContentLength = reqBody.Length; 
       request.Method = "POST"; 
       // write the body of the request 
       byte[] body2 = System.Text.Encoding.UTF8.GetBytes(reqBody); 
       Stream dataStream2 = request.GetRequestStream(); 
       dataStream2.Write(body2, 0, reqBody.Length); 
       dataStream2.Close(); 
       // read the response 
       webResponse = (HttpWebResponse)request.GetResponse(); 
       sr = new StreamReader(webResponse.GetResponseStream()); 
       responseText = sr.ReadToEnd(); 
       using (XmlReader reader = XmlReader.Create(new StringReader(responseText))) 
       { 
        while (reader.Read()) 
        { // Parse the xml response body 
         if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "url")) 
          url = reader.ReadString(); 
        } 
       } 
       Console.WriteLine("Embeded View Result --> " + responseText); 
       System.Diagnostics.Process.Start(url); 
      } 
      catch (WebException e) 
      { 
       using (WebResponse response = e.Response) 
       { 
        HttpWebResponse httpResponse = (HttpWebResponse)response; 
        Console.WriteLine("Error code: {0}", httpResponse.StatusCode); 
        using (Stream data = response.GetResponseStream()) 
        { 
         string text = new StreamReader(data).ReadToEnd(); 
         Console.WriteLine(text); 
        } 
       } 
      } 

     } 

    } 
} 



[enter image description here][1] 


    [1]: https://i.stack.imgur.com/iGx0U.jpg 

答えて

1

フルネーム会社タブは「標準」タブの種類ではなく、「カスタム」タブタイプです。スキーマやWSDLを見れば、本物の本質を見ることができます。 RESTを使用する場合でも、コンセプトはそのまま適用されます。区別は、「カスタム」タブの種類は、受信者入力されながら、「標準」タブタイプ(等signHereinitialHeredateSignedが)、受信者情報に由来し、署名時に装着されていることですタブ(テキスト,リスト,チェックボックスなど)。 「標準」タブタイプの値をあらかじめ入力または事前設定することができます(例外は、DSメンバーのタイトルや会社など、オプションで値のない受信者情報用です)。

したがって、fullNameは、署名採用時に署名者が提供したフルネームに基づいて入力されます。署名者がDocuSignアカウントのメンバーシップを持っている場合は会社タブが表示されます。それ以外の場合は、あらかじめ入力することができます(のタイトルタブのような場合と、メンバーのオプションデータに依存するその他の場合)。

キャプティブ受信者を指定している特定のケースでは、これらのメンバーはすべてのDSメンバーと一致しないため、会社タブをあらかじめ入力する必要があります。しかし、適切なタブタイプのXML要素、つまり<companyTabs>の中でこれを行う必要があります。

関連する問題