使用vb.net记录Web服务-锚定标记自定义

使用vb.net记录Web服务-锚定标记自定义,vb.net,docusignapi,Vb.net,Docusignapi,这就是我遇到的问题 我有一个使用DocuSign web服务创建的文档 我可以在上面创建普通字段/选项卡,即SignHere/SignDate/Initial字段 然而,当我想使用自定义字段时,它就是不起作用。代码将运行并发送文档,但替换预期自定义字段的只是一个bisc文本框。这就像是忽略了自定义字段设置 我已附上我用作参考的文件,我的代码如下 一切正常,但我认为问题出在2个客户字段所在的部分 Dim DocuSignSoap As New ServiceReference2.DSAPIServ

这就是我遇到的问题

我有一个使用DocuSign web服务创建的文档

我可以在上面创建普通字段/选项卡,即SignHere/SignDate/Initial字段

然而,当我想使用自定义字段时,它就是不起作用。代码将运行并发送文档,但替换预期自定义字段的只是一个bisc文本框。这就像是忽略了自定义字段设置

我已附上我用作参考的文件,我的代码如下

一切正常,但我认为问题出在2个客户字段所在的部分

Dim DocuSignSoap As New ServiceReference2.DSAPIServiceSoapClient
Dim DocuSignRecipient(0) As ServiceReference2.Recipient
Dim DocuSignRecipientType As ServiceReference2.RecipientTypeCode
Dim DocuSignTabType As ServiceReference2.TabTypeCode
Dim DocuSignCustomTabType As ServiceReference2.CustomTabType
Dim DocuSignEnvelope As New ServiceReference2.Envelope
Dim DocuSignDocument(0) As ServiceReference2.Document
Dim DocuSignTab(7) As ServiceReference2.Tab
Dim DocuSignEnvelopeStatus As ServiceReference2.EnvelopeStatus
Dim DocusignSig1 As New ServiceReference2.AnchorTab
Dim DocusignSig2 As New ServiceReference2.AnchorTab
Dim DocusignDateLOA As New ServiceReference2.AnchorTab
Dim DocusignDDDate As New ServiceReference2.AnchorTab
Dim DocusignFreq1 As New ServiceReference2.AnchorTab
Dim DocusignFreq2 As New ServiceReference2.AnchorTab
Dim DocusignFreq3 As New ServiceReference2.AnchorTab
Dim DocusignFreq4 As New ServiceReference2.AnchorTab
Dim strAuth As String
Dim strDocID As String

strDocID = Format(Now, "ddMMyyyyhhmmss")

Dim Mystream As New FileStream("c:\dantestdocusign.pdf", FileMode.Open)
Dim filesize As Long = Mystream.Length
Dim buffer(filesize) As Byte

Mystream.Read(buffer, 0, filesize)
Mystream.Close()

'Create Recipent
DocuSignRecipient(0) = New ServiceReference2.Recipient
DocuSignRecipient(0).Email = "daniel.rodgers@idebtplan.co.uk"
DocuSignRecipient(0).UserName = "Daniel Rodgers"
DocuSignRecipient(0).SignerName = "Daniel Rodgers"
DocuSignRecipient(0).Type = DocuSignRecipientType.Signer
DocuSignRecipient(0).ID = "1"
DocuSignRecipient(0).RoutingOrder = 1

'Create the envelope content
DocuSignEnvelope.Subject = "Your iDebtPlan Pack"
DocuSignEnvelope.EmailBlurb = "Email content"
DocuSignEnvelope.Recipients = DocuSignRecipient
DocuSignEnvelope.AccountId = "2f447fb0-243a-4a3f-acb5-adefbef43492"

'Create the document
DocuSignDocument(0) = New ServiceReference2.Document
DocuSignDocument(0).ID = strDocID
DocuSignDocument(0).Name = "DAN TESTING DOC"
DocuSignDocument(0).PDFBytes = buffer

' Attach the document(s)
DocuSignEnvelope.Documents = DocuSignDocument

' Create a new signature tab 1
DocuSignTab(0) = New ServiceReference2.Tab
DocuSignTab(0).DocumentID = DocuSignDocument(0).ID
DocuSignTab(0).RecipientID = "1"
DocuSignTab(0).Type = DocuSignTabType.SignHere
DocusignSig1.AnchorTabString = "\s1\"
DocuSignTab(0).AnchorTabItem = DocusignSig1
DocuSignTab(0).TabLabel = "Sig1"

' Create a new signature tab 2
DocuSignTab(1) = New ServiceReference2.Tab
DocuSignTab(1).DocumentID = DocuSignDocument(0).ID
DocuSignTab(1).RecipientID = "1"
DocuSignTab(1).Type = DocuSignTabType.SignHere
DocusignSig2.AnchorTabString = "\s2\"
DocuSignTab(1).AnchorTabItem = DocusignSig2
DocuSignTab(1).TabLabel = "Sig2"

' Create a DateLOA
DocuSignTab(2) = New ServiceReference2.Tab
DocuSignTab(2).DocumentID = DocuSignDocument(0).ID
DocuSignTab(2).RecipientID = "1"
DocuSignTab(2).Type = DocuSignTabType.DateSigned
DocusignDateLOA.AnchorTabString = "\loadate\"
DocuSignTab(2).AnchorTabItem = DocusignDateLOA
DocuSignTab(2).TabLabel = "DateLOA"

'CUSTOM FIELD 1
' Create a DD Date
DocuSignTab(3) = New ServiceReference2.Tab
DocuSignTab(3).DocumentID = DocuSignDocument(0).ID
DocuSignTab(3).RecipientID = "1"
DocuSignTab(3).Type = 11
DocuSignTab(3).CustomTabType = 4 'date
DocuSignTab(3).CustomTabWidth = 100
DocuSignTab(3).CustomTabDisableAutoSize = True
DocuSignTab(3).CustomTabRequired = True
DocuSignTab(3).CustomTabValidationPattern ="(^(?:(?:[12][0-9]|0?[1-9])/0?2|(?:30|[12][0-9]|0?[1-9])/(?:0?[469]|11)|(?:3[01]|[12][0-9]|0?[1-9])/(?:0?[13578]|1[02]))/\d{4}$)"
DocuSignTab(3).MaxLength = 10
DocuSignTab(3).CustomTabValidationMessage = "Your First Payment Date
Must be format dd/mm/yyyy (example: 01/03/2012), and a valid UK Date"
DocusignDDDate.AnchorTabString = "\dddate\"
DocuSignTab(3).AnchorTabItem = DocusignDDDate
DocuSignTab(3).TabLabel = "DDDate"

'CUSTOM FIELD 2
''Create Frequency Radio Buttons
DocuSignTab(4) = New ServiceReference2.Tab
DocuSignTab(4).DocumentID = DocuSignDocument(0).ID
DocuSignTab(4).RecipientID = "1"
DocuSignTab(4).Type = 11
DocuSignTab(4).CustomTabType = 2 'radio
DocuSignTab(4).CustomTabRequired = True
DocuSignTab(4).CustomTabWidth = 100
DocuSignTab(4).CustomTabDisableAutoSize = True
DocuSignTab(4).CustomTabRadioGroupName = "Frequency"
DocuSignTab(4).TabLabel = "Frequency"
DocuSignTab(4).Value = ""
DocusignFreq1.AnchorTabString = "\ow\"
DocuSignTab(4).AnchorTabItem = DocusignFreq1
DocuSignEnvelope.Tabs = DocuSignTab

strAuth = "<DocuSignCredentials<Usernameinfo@idebtplan.co.uk<mailto:info@idebtplan.co.uk</Username<Passwordjemima79</Password<IntegratorKeyIDEB-8ce296aa-0dff-4347-8ece-b62836a6a94e</IntegratorKey</DocuSignCredentials"


Dim x As New OperationContextScope(DocuSignSoap.InnerChannel)
Dim httpRequest As New System.ServiceModel.Channels.HttpRequestMessageProperty
httpRequest.Headers.Add("X-DocuSign-Authentication", strAuth)
OperationContext.Current.OutgoingMessageProperties(httpRequest.Name) = httpRequest

' Create the envelope on the account -- it will be a draft
DocuSignEnvelopeStatus = DocuSignSoap.CreateAndSendEnvelope(DocuSignEnvelope)
buffer = Nothing
Mystream = Nothing
httpRequest = Nothing
Dim DocuSignSoap作为新服务引用2.DSAPIServiceSoapClient
Dim DocuSignRecipient(0)作为服务引用2。收件人
Dim DocuSignRecipientType作为服务引用2.RecipientTypeCode
Dim DocuSignTabType作为服务引用2.TABTYPE代码
Dim DocuSignCustomTabType作为服务引用2.CustomTabType
Dim DOCUSINGENVELOPE As新服务参考2.信封
Dim DocuSignDocument(0)作为服务引用2.文档
Dim DocuSignTab(7)作为服务参考2.Tab
Dim DOCUSINGENVELOPESTATUS As SERVICEREFERENCE 2.EnvelopeStatus
Dim DocusignSig1作为新服务参考2.AnchorTab
Dim DOCUSIG2作为新服务参考2.AnchorTab
Dim DocusignDateLOA作为新服务参考2.AnchorTab
Dim DocusignDDDate作为新服务参考2.AnchorTab
Dim DocusignFreq1作为新服务参考2.AnchorTab
Dim DOCUSIGNFREK2作为新服务参考2.AnchorTab
Dim docusingfreq3作为新服务参考2.AnchorTab
Dim DOCUSIGNFREK4作为新服务参考2.AnchorTab
将strAuth变暗为字符串
作为字符串的Dim strDocID
strDocID=格式(现在为“ddmmyyyhhmmss”)
将Mystream设置为新文件流(“c:\dantestdocusign.pdf”,FileMode.Open)
Dim filesize As Long=Mystream.Length
将缓冲区(文件大小)设置为字节
读取(缓冲区,0,文件大小)
Mystream.Close()
“创建收件人”
DocuSignRecipient(0)=新服务引用2。收件人
DocuSignRecipient(0)。电子邮件=“丹尼尔。rodgers@idebtplan.co.uk"
DocuSignRecipient(0)。用户名=“丹尼尔·罗杰斯”
DocuSignRecipient(0)。SignerName=“丹尼尔·罗杰斯”
DocuSignRecipient(0).Type=DocuSignRecipientType.Signer
DocuSignRecipient(0)。ID=“1”
DocuSignRecipient(0)。路由顺序=1
'创建信封内容
DocuSignEnvelope.Subject=“您的iDebtPlan包”
DocuSignEnvelope.EmailBlurb=“电子邮件内容”
DocuSignEnvelope.Recipients=DocuSignRecipient
DocuSignEnvelope.AccountId=“2f447fb0-243a-4a3f-acb5-ADEFBF43492”
'创建文档
DocuSignDocument(0)=新服务引用2.文档
DocuSignDocument(0).ID=strDocID
DocuSignDocument(0).Name=“DAN测试文档”
DocuSignDocument(0).PDFBytes=缓冲区
'附加文档
DocuSignEnvelope.Documents=DocuSignDocument
'创建新的签名选项卡1
DocuSignTab(0)=新服务引用2.Tab
DocuSignTab(0).DocumentID=DocuSignDocument(0).ID
DocuSignTab(0)。RecipientID=“1”
DocuSignTab(0).Type=DocuSignTabType.SignHere
DocusignSig1.AnchorTabString=“\s1\”
DocuSignTab(0).AnchorTabItem=DocusignSig1
DocuSignTab(0).TabLabel=“Sig1”
'创建新签名选项卡2
DocuSignTab(1)=新服务引用2.Tab
DocuSignTab(1).DocumentID=DocuSignDocument(0).ID
DocuSignTab(1)。RecipientID=“1”
DocuSignTab(1).Type=DocuSignTabType.SignHere
DocusignSig2.AnchorTabString=“\s2\”
DocuSignTab(1).AnchorTabItem=DocusignSig2
DocuSignTab(1).TabLabel=“Sig2”
'创建日期LOA
DocuSignTab(2)=新服务引用2.Tab
DocuSignTab(2).DocumentID=DocuSignDocument(0).ID
DocuSignTab(2)。RecipientID=“1”
DocuSignTab(2).Type=DocuSignTabType.DateSigned
DocusignDateLOA.AnchorTabString=“\loadate\”
DocuSignTab(2).AnchorTabItem=DocusignDateLOA
DocuSignTab(2).TabLabel=“DateLOA”
'自定义字段1
'创建DD日期
DocuSignTab(3)=新服务引用2.Tab
DocuSignTab(3).DocumentID=DocuSignDocument(0).ID
DocuSignTab(3)。RecipientID=“1”
DocuSignTab(3).类型=11
DocuSignTab(3)。CustomTabType=4'日期
DocuSignTab(3)。CustomTabWidth=100
DocuSignTab(3).CustomTabDisableAutoSize=True
DocuSignTab(3).CustomTabRequired=True
DocuSignTab(3).CustomTabValidationPattern=“(^(?:[12][0-9]|[1-9])/0-2 |(?:30 |[12][0-9]|[1-9])/(?:0?[469]| 11)|(?:3[01]|[12][0-9]|[0-9]|[1-9])/(?:0?[13578]12478]| 1[02])/(d{4})”
DocuSignTab(3)。最大长度=10
DocuSignTab(3).CustomTabValidationMessage=“您的第一个付款日期
格式必须为dd/mm/yyyy(例如:2012年3月1日),并且必须是有效的英国日期“
DocusignDDDate.AnchorTabString=“\dddate\”
DocuSignTab(3).AnchorTabItem=DocusignDDDate
DocuSignTab(3).TabLabel=“DDDate”
'自定义字段2
''创建频率单选按钮
DocuSignTab(4)=新服务引用2.Tab
DocuSignTab(4).DocumentID=DocuSignDocument(0).ID
DocuSignTab(4)。RecipientID=“1”
DocuSignTab(4).类型=11
DocuSignTab(4)。CustomTabType=2'收音机
DocuSignTab(4).CustomTabRequired=True
DocuSignTab(4)。CustomTabWidth=100
DocuSignTab(4).CustomTabDisableAutoSize=True
DocuSignTab(4).CustomTabRadioGroupName=“频率”
DocuSignTab(4).TabLabel=“频率”
DocuSignTab(4)。Value=“”
docusingfreq1.AnchorTabString=“\ow\”
DocuSignTab(4).AnchorTabItem=DocusignFreq1
DocuSignEnvelope.Tabs=DocuSignTab

strAuth=“我建议如下:

  • 尝试在不使用锚定选项卡的情况下添加自定义字段(即使用绝对定位)
  • 将自定义字段的配置方式与中的示例代码进行比较
  • 使用DocuSign中更新的restapi创建信封