В имени и фамилии получателя отсутствует пробел - PullRequest
0 голосов
/ 02 мая 2018

В сгенерированном документе DS поле Имя заполняется именем и фамилией без пробела (BrackObama), мы хотим пробел между fn и ln (Барак Обама). Как мне добавить пробел? Я не уверен

Я генерирую конверт и документ с помощью API DS SF. Когда я пытаюсь добавить пробел между ними, я не могу и получаю следующее исключение. System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: The recipient you have identified is not a valid recipient of the specified envelope. faultcode=soap:Client faultactor=https://demo.docusign.net/api/3.0/dsapi.asmx

     // Recipient
    DocuSignAPI.Recipient recipient = new DocuSignAPI.Recipient();
    recipient.ID = 1;
    recipient.Type_x = Constants.const_Signer;
    recipient.RoutingOrder = 1;
    recipient.Email = cnt.EmailAddress1__c;
    recipient.RoleName = Constants.const_RoleCustomer;

    recipient.UserName = cnt.FirstName__c + cnt.LastName__c; //tried adding a space here...
    recipient.RequireIDLookup = false;  
    recipient.captiveInfo = new DocuSignAPI.RecipientCaptiveInfo();
    recipient.captiveInfo.ClientUserId = clientUserID;
    DocuSignAPI.ArrayOfRecipient1 Recipients = new DocuSignAPI.ArrayOfRecipient1();
    Recipients.Recipient = new DocuSignAPI.Recipient[1];
    Recipients.Recipient[0] = recipient;       

    envelope.Recipients = new DocuSignAPI.ArrayOfRecipient();
    envelope.Recipients.Recipient = new DocuSignAPI.Recipient[1];
    envelope.Recipients.Recipient[0] = recipient;

    envelope.AccountId = objConstantSetting.Docusign_Account_ID__c;

    envelope.Autonavigation = true;

    // Envelope needs Documents, Recipients, Tabs and a Subject.
    envelope.Tabs = new DocuSignAPI.ArrayOfTab();
    envelope.Tabs.Tab = new List<DocuSignAPI.Tab>();


    DocuSignAPI.Tab t = new DocuSignAPI.Tab();
    t.Name  = 'Name';
    t.Type_x = 'FullName';
    DocuSignAPI.AnchorTab at = new DocuSignAPI.AnchorTab();
    at.AnchorTabString = dsTag.AnchorTabString__c;

    t.RecipientID =  recipient.ID;

    t.CustomTabRequired = true;


    at.IgnoreIfNotPresent  = true;
    t.AnchorTabItem = at;
    envelope.Tabs.Tab.add(t);    





    envelope.Subject = Label.Docusign_Email_Subject; // + account.AccountNumber;

1 Ответ

0 голосов
/ 03 мая 2018

Вышеуказанная ошибка обычно возникает, когда вы пытаетесь сгенерировать RequestRecipientToken для встроенных подписчиков, а данные получателя, которые вы передаете в RequestRecipientToken API-вызов, не совпадают с данными в конверте.

Ниже приведен вызов SOAP API для создания конверта с вкладкой FullName и именем получателя с пробелом, который подходит для документа. Попробуйте протестировать поток с помощью SOAPUI.

Создать конверт звонка:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.docusign.net/API/3.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:CreateAndSendEnvelope>
         <ns:Envelope>
           <ns:AccountId>e6043e37-08a9-4892-9e12-75b4d8bfef2a</ns:AccountId>
            <ns:Documents>
               <ns:Document>
                <ns:ID>32093411</ns:ID>
                <ns:Name>Document Name</ns:Name>
                <ns:PDFBytes>PDFBytes</ns:PDFBytes>
                <ns:FileExtension>pdf</ns:FileExtension>
            </ns:Document>
            </ns:Documents>
            <ns:Recipients>
               <ns:Recipient>
                  <ns:ID>45399085</ns:ID>
                  <ns:UserName>FirstName LastName</ns:UserName>
                  <ns:Email>email@gmail.com</ns:Email>
                  <ns:Type>Signer</ns:Type>
                  <ns:RoutingOrder>1</ns:RoutingOrder>
                  <ns:CaptiveInfo>
                     <ns:ClientUserId>1234</ns:ClientUserId>
                  </ns:CaptiveInfo>
               </ns:Recipient>
            </ns:Recipients>
            <ns:Tabs>
            <ns:Tab>
                <ns:DocumentID>32093411</ns:DocumentID>
                <ns:RecipientID>45399085</ns:RecipientID>
                <ns:PageNumber>1</ns:PageNumber>
                <ns:XPosition>71</ns:XPosition>
                <ns:YPosition>500</ns:YPosition>
                <ns:ScaleValue>1</ns:ScaleValue>
                <ns:Type>FullName</ns:Type>
                <ns:Name>FullName</ns:Name>
                <ns:TabLabel>Name d39c7430-7321-4c97-a1b9-5d980fda7883</ns:TabLabel>
                <ns:CustomTabRequired>false</ns:CustomTabRequired>
                <ns:CustomTabLocked>false</ns:CustomTabLocked>
                <ns:TemplateLocked>false</ns:TemplateLocked>
                <ns:TemplateRequired>false</ns:TemplateRequired>
                <ns:Font>LucidaConsole</ns:Font>
                <ns:FontColor>Black</ns:FontColor>
                <ns:FontSize>Size9</ns:FontSize>
            </ns:Tab>
        </ns:Tabs>
            <ns:Subject>Email Subject</ns:Subject>
            <ns:EmailBlurb>Email Blurb</ns:EmailBlurb>
         </ns:Envelope>
      </ns:CreateAndSendEnvelope>
   </soapenv:Body>
</soapenv:Envelope>

RequestRecipientToken:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.docusign.net/API/3.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:RequestRecipientToken>
         <ns:EnvelopeID>ece0d433-52a7-4e0c-a502-c57ff205df3c</ns:EnvelopeID>
         <ns:ClientUserID>1234</ns:ClientUserID>
         <ns:Username>FirstName LastName</ns:Username>
         <ns:Email>email@gmail.com</ns:Email>
         <ns:AuthenticationAssertion>
            <ns:AuthenticationInstant>2017-08-09T01:25:33Z</ns:AuthenticationInstant>
            <ns:AssertionID>1234</ns:AssertionID>
            <ns:AuthenticationMethod>Password</ns:AuthenticationMethod>
            <ns:SecurityDomain>www.google.com</ns:SecurityDomain>
         </ns:AuthenticationAssertion>
         <ns:ClientURLs>
            <ns:OnSigningComplete><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnSigningComplete>
            <ns:OnViewingComplete><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnViewingComplete>
            <ns:OnCancel><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnCancel>
            <ns:OnDecline><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnDecline>
            <ns:OnSessionTimeout><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnSessionTimeout>
            <ns:OnTTLExpired><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnTTLExpired>
            <ns:OnException><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnException>
            <ns:OnAccessCodeFailed><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnAccessCodeFailed>
            <ns:OnIdCheckFailed><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnIdCheckFailed>
            <ns:OnFaxPending><![CDATA[http://www.google.com?envId=[[envelopeId]]&recipientEmail=[[recipientEmail]]]]></ns:OnFaxPending>
         </ns:ClientURLs>
      </ns:RequestRecipientToken>
   </soapenv:Body>
</soapenv:Envelope>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...