2014-09-03 112 views
0

我正在嘗試與DocuSign Connect服務集成。我已經設置了一個WCF服務來處理這個問題,但到目前爲止沒有正確接收DocuSignEnvelopeInformation對象的運氣。爲什麼在我的WCF中收到DocuSignEnvelopeInformation對象爲空?

我認爲這與Mark Ba​​iley在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 

的DocuSignConnectUpdate總是返回 「無包膜收到的信息」 通過的DocuSign Connect服務發佈EnvelopeInformation時(但我的本地測試工作正常客戶)。

我的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>[email protected]</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>[email protected]</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>[email protected]</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> 

有什麼建議嗎?

+0

是什麼在你的XML的區別和DocuSign的XML是否被推送?你可以發佈他們兩個來查看? – Andrew 2014-09-03 20:36:20

+0

@AndrewWilson XML沒有區別。我用於測試客戶端的XML取自DocuSign Connect Logs,所以它應該是相同(XML Appende d)。 – Russell 2014-09-04 14:28:23

+0

請發佈你的輸入,你將進入.net爲他們兩個。如果他們是一樣的,他們都會工作。 (不是來自連接日誌) – Andrew 2014-09-05 19:30:07

回答

0

嘗試以下裝飾器,其中your_descriptor可以是所有服務的通用屬性或更具體。

的http://您的網域/ your_descriptor「)> 公共接口IDSConnectService

[OperationContract(Action = "http://your_domain/your_descriptor/DocuSignConnectUpdate", 
    ReplyAction = "http://your_domain/your_descriptor/DocuSignConnectUpdateResponse" 
    )] 
Function DocuSignConnectUpdate(ByVal DocuSignEnvelopeInformation As DocuSignEnvelopeInformation)As String 

(無裝飾或使用的命名空間以上) 公共類DSConnectService 器具IDSConnectService