【发布时间】:2014-10-28 02:39:30
【问题描述】:
我正在尝试与 DocuSign Connect 服务集成。我已经设置了一个 WCF 服务来处理这个问题,但到目前为止还没有正确接收 DocuSignEnvelopeInformation 对象。
我相信这与 Mark Bailey 在 12 月发布的问题有关:Why is my WCF web service presenting this object in a different namespace with different field names?。但是,正如您将在我的代码中看到的那样,我已经在界面中用 [XmlSerializerFormat] 标记了 DocuSignConnectUpdate 方法。我还缺少什么吗?
我的界面:
<ServiceContract(Namespace:="http://www.docusign.net/API/3.0")>
Public Interface IDSConnectService
<OperationContract()>
<XmlSerializerFormat()>
Function DocuSignConnectUpdate(ByVal DocuSignEnvelopeInformation As DocuSignEnvelopeInformation)As String
End Interface
我的班级:
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)>
<ServiceBehavior(AddressFilterMode:=AddressFilterMode.Any, Namespace:="http://www.docusign.net/API/3.0")>
Public Class DSConnectService
Implements IDSConnectService
Public Function DocuSignConnectUpdate(ByVal DocuSignEnvelopeInformation As DocuSignEnvelopeInformation) As String Implements IDSConnectService.DocuSignConnectUpdate
If Not DocuSignEnvelopeInformation Is Nothing Then
...........
Return DocuSignEnvelopeInformation.EnvelopeStatus.EnvelopeID
Else
Return "No Envelope Information Received"
End If
End Function
通过 DocuSign Connect 服务发布 EnvelopeInformation 时,DocuSignConnectUpdate 始终返回“未收到信封信息”(但对我的本地测试客户端工作正常)。
我的 web.config 设置:
......
<system.serviceModel>
<services>
<service name="MyService.DSConnectService" behaviorConfiguration="MyBehavior" >
<endpoint address=""
binding="basicHttpBinding"
contract="MyService.IDSConnectService"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="xmlEndpointBehavior">
<webHttp helpEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
编辑: 以下是 DocuSign 和我的测试客户端发送的 XML 示例(我从 Connect 日志中复制了 xml,并在客户端请求中使用了它)。
<?xml version="1.0" encoding="UTF-8"?>
<DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>role99@email.com</Email>
<UserName>Producer Name</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2014-09-04T09:51:52.107</Sent>
<Delivered>2014-09-04T09:55:26.62</Delivered>
<Signed>2014-09-04T09:55:26.62</Signed>
<DeclineReason xsi:nil="true"/>
<Status>Completed</Status>
<RecipientIPAddress>255.255.255.255</RecipientIPAddress>
<ClientUserId>99</ClientUserId>
<CustomFields/>
<AccountStatus>Active</AccountStatus>
<RecipientId>276567ad-763a-45e5-a5b2-38572dfa6bb8</RecipientId>
</RecipientStatus>
</RecipientStatuses>
<TimeGenerated>2014-09-04T09:55:46.5725646</TimeGenerated>
<EnvelopeID>01f83c1a-135f-438f-87cc-57ce74aba050</EnvelopeID>
<Subject>Russell Test Signing your Application</Subject>
<UserName>Russell Test</UserName>
<Email>my@email.com</Email>
<Status>Completed</Status>
<Created>2014-09-04T09:51:51.793</Created>
<Sent>2014-09-04T09:51:52.153</Sent>
<Delivered>2014-09-04T09:55:26.683</Delivered>
<Signed>2014-09-04T09:55:26.683</Signed>
<Completed>2014-09-04T09:55:26.683</Completed>
<ACStatus>Original</ACStatus>
<ACStatusDate>2014-09-04T09:51:51.793</ACStatusDate>
<ACHolder>Russell Test</ACHolder>
<ACHolderEmail>my@email.com</ACHolderEmail>
<ACHolderLocation>DocuSign</ACHolderLocation>
<SigningLocation>Online</SigningLocation>
<SenderIPAddress>255.255.255.255 </SenderIPAddress>
<EnvelopePDFHash/>
<CustomFields>
</CustomFields>
<AutoNavigation>true</AutoNavigation>
<EnvelopeIdStamping>true</EnvelopeIdStamping>
<AuthoritativeCopy>false</AuthoritativeCopy>
<DocumentStatuses>
<DocumentStatus>
<ID>1</ID>
<Name>TestForm1</Name>
<TemplateName/>
<Sequence>1</Sequence>
</DocumentStatus>
<DocumentStatus>
<ID>2</ID>
<Name>TestForm2</Name>
<TemplateName/>
<Sequence>2</Sequence>
</DocumentStatus>
<DocumentStatus>
<ID>3</ID>
<Name>TestForm3</Name>
<TemplateName/>
<Sequence>3</Sequence>
</DocumentStatus>
<DocumentStatus>
<ID>4</ID>
<Name>Signed-on-Paper_276567ad-763a-45e5-a5b2-38572dfa6bb8</Name>
<TemplateName/>
<Sequence>4</Sequence>
</DocumentStatus>
</DocumentStatuses>
</EnvelopeStatus>
</DocuSignEnvelopeInformation>
有什么建议吗?
【问题讨论】:
-
你的 XML 和被推送的 DocuSign 的 XML 有什么区别?你能把它们都发上来看看吗?
-
@AndrewWilson XML 没有区别。我用于测试客户端的 XML 取自 DocuSign Connect Logs。所以应该是一样的(附加XML)。
-
请发布您正在为他们两个进入 .net 的输入。如果它们相同,那么它们都可以工作。 (不是来自连接日志)
-
@Russell 这个运气好吗?我被困在同一件事上!
标签: wcf docusignapi