【问题标题】:DocuSign SoapAPI Sample doesn't workDocuSign SoapAPI 示例不起作用
【发布时间】:2013-10-10 18:05:43
【问题描述】:

我刚刚开始使用 DocuSign SOAP API,我正在使用他们的开发人员站点以及 GitHub 站点中的示例。虽然这两位代码并不完全匹配,但似乎都不起作用。我不断收到 System.ServiceModel.FaultException 消息,“由于传入消息中不存在安全标头,因此不满足安全要求。”

我正在使用带有 VS2012 的服务参考来代理服务 https://demo.docusign.net/api/3.0/dsapi.asmx,并且我已通过使用在线 REST API 资源管理器获取我的演示帐户的登录信息来验证我的帐户是否正常工作。

有人遇到过这个问题或有什么建议吗?

【问题讨论】:

    标签: .net docusignapi


    【解决方案1】:

    在我更改 web.config 中的绑定元素以匹配此之前,我收到了相同的错误消息:

    <binding name="APIServiceSoap" allowCookies="true" maxReceivedMessageSize="50000000">
                <security mode="TransportWithMessageCredential" />
    </binding>
    

    Github DocuSign SDK 对我来说是一个宝贵的资源:@​​987654321@

    另外,正如上面的 Github 链接,我正在使用 2 个服务引用(CredentialAPI 和 DocuSignAPI)。

    【讨论】:

      【解决方案2】:

      我发现我必须创建一个指向 https://demo.docusign.net/api/3.0/dsapi.asmx 的服务引用(而不是 Web 引用)(而不是 http://www.docusign.com/p/APIGuide/Content/DocuSignService%20API%20Overview/Code%20Samples.htm 的示例所暗示的 https://demo.docusign.net/api/3.0/api.asmx)。

      我还必须确保使用此处的示例代码版本 http://www.docusign.com/p/APIGuide/APIGuide.htm#Introduction+Changes/Using DocuSign WSDLs in the Net Environment.htm%3FTocPath%3DUsing%20DocuSign%20WSDLs%7C___1 将“X-DocuSign-Authentication”添加到请求标头中

      【讨论】:

        【解决方案3】:

        使用 DocuSign 的 SOAP API 传递成员凭据有两种方法:

        1. 通过 WS-Security UsernameToken 的 SOAP 标头
        2. HTTP Header 通过自定义字段“X-DocuSign-Authentication”

        DocuSign SOAP API 有两个不同的端点,除了身份验证之外一切都相同:API.asmxDSAPI.asmxAPI.asmx 端点需要 SOAP 标头身份验证中的 WS-Security UsernameToken。 DSAPI.asmxAccountManagement.asmx 端点需要 HTTP Header 身份验证方法。

        有关更多信息,请参阅 DocuSign 的 SOAP 文档: http://www.docusign.com/developer-center/documentation

        【讨论】:

        • 考虑到它是一个 asmx Web 服务,我认为它需要一个 webref,但随后 ClientCredentials 属性从 apiclient 对象中消失,示例代码变得毫无意义。
        • ClientCredentials 属性仅适用于 asmx 服务之一,这就是它消失的原因。那么您在这种情况下解决了您的问题吗?
        • 引用docusign.com/p/APIGuide/Content/…,这显然是使用对demo.docusign.net/api/3.0/api.asmx 的服务引用(不是dsapi.asmx)。如果我创建一个 Web 引用,这个示例代码就会中断。所以没有解决方案。
        猜你喜欢
        • 2019-11-21
        • 1970-01-01
        • 2012-07-05
        • 2013-12-04
        • 2016-08-31
        • 2016-02-25
        • 2015-01-23
        • 2017-09-11
        • 1970-01-01
        相关资源
        最近更新 更多