我一直在試圖讓Anchor Tabs通過.NET使用DocuSign SOAP API工作。我已經成功地獲得了正常的選項卡,使用類似的方法工作(當然不包括AnchorTabItem代碼)。Anchor Tabs不適用於通過DocuSign使用.NET SOAP API發送的文檔
當文檔與指定的固定標籤一起發送時,標籤不會顯示在任何收件人的文檔上。相反,每個收件人是能夠把自己的簽名選項卡上的文件,如下圖所示:
當我嘗試使用web界面上它完美的作品,並發現了一個模板來創建錨接片我在Row("anchorString")
變量中指定的文檔上的文本。以下是我用來添加選項卡並將其分配給文檔ID和收件人ID的代碼。 Data.Tab.GetTabsByDocName
用於獲取標籤位置和收件人角色。
Dim DT As DataTable = Data.Tab.GetTabsByDocName(DocName)
Dim Tabs As New List(Of DemoDocuSign.Tab)
For Each Row As DataRow In DT.Rows
Dim Tab As New DemoDocuSign.Tab With {.AnchorTabItem = New DemoDocuSign.AnchorTab()}
With Tab
.Type = [Enum].Parse(GetType(DemoDocuSign.TabTypeCode), Row("type"))
.TabLabel = Row("role")
.PageNumber = Row("pageNum")
.AnchorTabItem.AnchorTabString = Row("anchorString")
.AnchorTabItem.IgnoreIfNotPresent = False
.AnchorTabItem.IgnoreIfNotPresentSpecified = True
.AnchorTabItem.Unit = DemoDocuSign.UnitTypeCode.Cms
.AnchorTabItem.UnitSpecified = True
.AnchorTabItem.YOffset = Row("yOffset")
.AnchorTabItem.XOffset = Row("xOffset")
End With
Next
If Recipients IsNot Nothing Then
For Each Recipient In Recipients
For Each Tab In Tabs
If Recipient.Role = Tab.TabLabel Then
Tab.RecipientID = Recipient.RecID
End If
Tab.DocumentID = Document.DocID
Next
Next
Dim FinalTabs As New List(Of DemoDocuSign.Tab)
For Each Tab In Tabs
If Tab.RecipientID <> "" Then
FinalTabs.Add(Tab)
End If
Next
Tabs = FinalTabs
End If
Return Tabs
我不知道爲什麼會發生這種情況,並且我沒有從SOAP端點收到任何錯誤,這些選項卡只是不顯示給收件人。
下面是請求的XML(帶有***省略的敏感信息)。好像沒有被附加在所有選項卡,即使我用同樣的方法,我通常做!:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2014-01-21T22:31:01.565Z</u:Created>
<u:Expires>2014-01-21T22:36:01.565Z</u:Expires>
</u:Timestamp>
<o:UsernameToken u:Id="uuid-cfaefba6-85c2-43e5-a3b8-cc6daa8cbf44-1">
<o:Username>***</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">***</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CreateAndSendEnvelope xmlns="http://www.docusign.net/API/3.0">
<Envelope>
<AccountId>***</AccountId>
<Documents>
<Document>
<ID>998</ID>
<Name>***.pdf</Name>
</Document>
</Documents>
<Recipients>
<Recipient>
<ID>1998</ID>
<UserName>Martin</UserName>
<Email>*@gmail.com</Email>
<Type>Signer</Type>
<AccessCode xsi:nil="true"/>
</Recipient>
<Recipient>
<ID>1999</ID>
<UserName>Test</UserName>
<Email>[email protected]</Email>
<Type>Signer</Type>
<AccessCode xsi:nil="true"/>
</Recipient>
</Recipients>
<Tabs/>
<Subject>***</Subject>
<EmailBlurb>Please sign the attached document for ****.</EmailBlurb>
<Notification>
<Reminders>
<ReminderEnabled>true</ReminderEnabled>
<ReminderDelay>2</ReminderDelay>
<ReminderFrequency>2</ReminderFrequency>
</Reminders>
</Notification>
</Envelope>
</CreateAndSendEnvelope>
</s:Body>
</s:Envelope>
編輯:這是因爲我沒有,我沒有Tabs.Add(製表)將每個標籤添加到我的列表中...愚蠢的錯誤!
發送給DocuSign的XML請求必須有錯誤。你能否更新你的問題來包含你的代碼生成的XML請求體(併發送給DocuSign)?您可以使用Fiddler或類似工具輕鬆地生成XML請求的跟蹤。 –
由於某些原因,您的文檔中沒有找到任何錨標籤字符串,因此簽名會話變成了所謂的自由格式簽名會話。基本上,當信封中沒有添加任何選項卡時,您將獲得該下拉列表,並且可以在文檔中隨時添加簽名選項卡。正如Kim所說,添加請求的XML(如果您願意,請刪除文檔字節),這應該有助於診斷問題。 – Ergin
謝謝我已經添加了XML請求 –