Docusignapi Docusign:用户名和密码中的一个或两个无效

Docusignapi Docusign:用户名和密码中的一个或两个无效,docusignapi,Docusignapi,我正在测试Docusign PHP API并尝试以下代码: $envelopeId = '3e979aac-1d8d-4ab9-rand-envelopid'; $api = new APIService(); $api->setCredentials('devaccountemail', 'devaccountpassword'); $userName = 'Test Signer'; $userEmail = 'random@randor.com';

我正在测试Docusign PHP API并尝试以下代码:

$envelopeId = '3e979aac-1d8d-4ab9-rand-envelopid';

    $api = new APIService();
    $api->setCredentials('devaccountemail', 'devaccountpassword');

    $userName = 'Test Signer';
    $userEmail = 'random@randor.com';
    $userId = '457';

    $RequestRecipientTokenParams = new RequestRecipientToken();
    $RequestRecipientTokenParams->EnvelopeID = $envelopeId;
    $RequestRecipientTokenParams->Username = $userName;
    $RequestRecipientTokenParams->Email = $userEmail;
    $RequestRecipientTokenParams->ClientUserID = $userId;

    $RequestRecipientTokenParams->AuthenticationAssertion->AssertionID = rand(0, 999);
    $RequestRecipientTokenParams->AuthenticationAssertion->AuthenticationInstant = date("Y")."-".date("m")."-".date("d")."T00:00:00.00";
    $RequestRecipientTokenParams->AuthenticationAssertion->AuthenticationMethod = RequestRecipientTokenAuthenticationAssertionAuthenticationMethod::Email;
    $RequestRecipientTokenParams->AuthenticationAssertion->SecurityDomain = "local IP Address";


    $RequestRecipientTokenParams->ClientURLs->OnAccessCodeFailed = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnAccessCodeFailed";
    $RequestRecipientTokenParams->ClientURLs->OnCancel = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnCancel";
    $RequestRecipientTokenParams->ClientURLs->OnDecline = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnDecline";
    $RequestRecipientTokenParams->ClientURLs->OnException = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnException";
    $RequestRecipientTokenParams->ClientURLs->OnFaxPending = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnFaxPending";
    $RequestRecipientTokenParams->ClientURLs->OnIdCheckFailed = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnIdCheckFailed";
    $RequestRecipientTokenParams->ClientURLs->OnSessionTimeout ="https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnSessionTimeout";
    $RequestRecipientTokenParams->ClientURLs->OnSigningComplete = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnSigningComplete";
    $RequestRecipientTokenParams->ClientURLs->OnTTLExpired = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnTTLExpired";
    $RequestRecipientTokenParams->ClientURLs->OnViewingComplete = "https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnViewingComplete";

    $RequestRecipientTokenResponse = $api->RequestRecipientToken($RequestRecipientTokenParams);
我得到了以下错误:

SoapFault : One or both of Username and Password are invalid.
我提供的凭据是有效的,我可以使用这些凭据登录到demo.docusign.net帐户。我不确定我哪里做错了

下面是正在生成的SOAP请求:

<?xml version="1.0" encoding="UTF-8"?> 
    <SOAP-ENV:Envelope xmlns:SOAP-
     ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.docusign.net/API/3.0" 
     xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
         <SOAP-ENV:Header>
            <wsa:Action>http://www.docusign.net/API/3.0/RequestRecipientToken</wsa:Action>
            <wsa:To>https://www.docusign.net/API/3.0/api.asmx</wsa:To>
            <wsa:MessageID>uudi:638fd49c-2516-12a9-8159-17a9c602975e</wsa:MessageID>
            <wsa:ReplyTo>
                <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
            </wsa:ReplyTo>
            <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
                <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                    <wsu:Created>2013-09-18T12:30:20Z</wsu:Created>
                    <wsu:Expires>2013-09-18T12:35:20Z</wsu:Expires>
                </wsu:Timestamp>
                <wsse:UsernameToken>
                    <wsse:Username>bhargav.bonu@somedomain.com</wsse:Username>
                    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-
         token-profile-1.0#PasswordText">mypassword</wsse:Password>
                    <wsse:Nonce>0PZkAUVbHHiyjV8KZrN6x2x0S6cQ5WbAjTH4yn8dnc4=</wsse:Nonce>
                    <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
         utility-1.0.xsd">2013-09-18T12:29:18Z</wsu:Created>
                </wsse:UsernameToken>
            </wsse:Security>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
            <ns1:RequestRecipientToken>
            <ns1:EnvelopeID>3e979aac-1d8d-4ab9-a45c-randElem</ns1:EnvelopeID>
            <ns1:Username>Test Signer</ns1:Username>
            <ns1:Email>Guest</ns1:Email>
            <ns1:AuthenticationAssertion>
                <ns1:AssertionID>175</ns1:AssertionID>
                <ns1:AuthenticationInstant>2013-09-18T00:00:00.00</ns1:AuthenticationInstant>
                <ns1:AuthenticationMethod>Email</ns1:AuthenticationMethod>
                <ns1:SecurityDomain>192.168.0.43</ns1:SecurityDomain></ns1:AuthenticationAssertion>
                <ns1:ClientURLs>
                    <ns1:OnSigningComplete>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnSigningComplete</ns1:OnSigningComplete>
                    <ns1:OnViewingComplete>https://YourApp.com/DocuSignCallback.html?
         envelopeId=YourEnvelopeId&amp;event=OnViewingComplete</ns1:OnViewingComplete>
                    <ns1:OnCancel>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnCancel</ns1:OnCancel>
                    <ns1:OnDecline>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnDecline</ns1:OnDecline>
                    <ns1:OnSessionTimeout>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnSessionTimeout</ns1:OnSessionTimeout>
                    <ns1:OnTTLExpired>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnTTLExpired</ns1:OnTTLExpired>
                    <ns1:OnException>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnException</ns1:OnException>
                    <ns1:OnAccessCodeFailed>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnAccessCodeFailed</ns1:OnAccessCodeFailed>
                    <ns1:OnIdCheckFailed>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnIdCheckFailed</ns1:OnIdCheckFailed>
                    <ns1:OnFaxPending>https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&amp;event=OnFaxPending</ns1:OnFaxPending>
                </ns1:ClientURLs>
            </ns1:RequestRecipientToken>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

http://www.docusign.net/API/3.0/RequestRecipientToken
https://www.docusign.net/API/3.0/api.asmx
uudi:638fd49c-2516-12a9-8159-17a9c602975e
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
2013-09-18T12:30:20Z
2013-09-18T12:35:20Z
巴尔加夫。bonu@somedomain.com
我的密码
0PZkAUVbHHiyjV8KZrN6x2x0S6cQ5WbAjTH4yn8dnc4=
2013-09-18T12:29:18Z
3e979aac-1d8d-4ab9-a45c-randElem
测试签名者
客人
175
2013-09-18T00:00:00.00
电子邮件
192.168.0.43
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=点火完成
https://YourApp.com/DocuSignCallback.html?
信封ID=您的信封ID&;事件=正在查看完成
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=取消
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=倾斜
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=会话超时
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=OnTTLExpired
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&event=OnException
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=OnAccessCodeFailed
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=OnIdCheckFailed
https://YourApp.com/DocuSignCallback.html?envelopeId=YourEnvelopeId&事件=OnFaxPending

该错误表示您在验证API调用的请求中提供的DocuSign用户凭据无效。您在本文中包含的代码实际上是不相关的,因为如果您为验证请求而提供的用户名或密码无效,任何API调用都会导致此错误


如果您还没有这样做,我建议您生成完整XML请求的跟踪(即,包括头),以仔细检查您在请求中提供的身份验证凭据。解决此类问题的最佳方法是检查发生了什么(而不是试图解决产生了什么的代码)——一旦XML中的问题被识别出来,在代码中修复应该很容易。

该错误表示您在验证API调用的请求中提供的DocuSign用户凭据无效。您在本文中包含的代码实际上是不相关的,因为如果您为验证请求而提供的用户名或密码无效,任何API调用都会导致此错误

如果您还没有这样做,我建议您生成完整XML请求的跟踪(即,包括头),以仔细检查您在请求中提供的身份验证凭据。解决此类问题的最佳方法是检查出现了什么问题(而不是试图解决产生了什么问题的代码问题)——一旦XML中的问题被识别出来,就应该很容易在代码中修复。

关于“用户名或密码无效”错误——这可能是因为您的用户名中没有包含Integrator密钥。DocuSign SOAP API指南()第18页:

integrator密钥必须放在UsernameToken的Username节点中的用户ID前面。积分器密钥必须用括号“[和]”包装。示例格式:

<wsse:Username>[Integrator Key]2988541c-4ec7-4245-b520-f2d324062ca3</wsse:Username>
[Integrator Key]2988541c-4ec7-4245-b520-f2d324062ca3
所有API请求中都必须包含Integrator密钥,因为DocuSign需要它来识别集成应用程序。

关于“用户名或密码无效”错误,这可能是因为您的用户名中没有包含Integrator密钥。DocuSign SOAP API指南()第18页:

integrator密钥必须放在UsernameToken的Username节点中的用户ID前面。积分器密钥必须用括号“[和]”包装。示例格式:

<wsse:Username>[Integrator Key]2988541c-4ec7-4245-b520-f2d324062ca3</wsse:Username>
[Integrator Key]2988541c-4ec7-4245-b520-f2d324062ca3

集成器密钥必须包含在所有API请求中,因为DocuSign需要它来识别集成应用程序。

我已经发布了正在生成的SOAP请求。这会有帮助吗?不应该与“用户名或密码无效”错误相关,但是--我注意到您的请求XML丢失--这是RequestRecipientToken请求中的必需元素。我已经发布了正在生成的SOAP请求。这会有帮助吗?不应该与“用户名或密码无效”错误相关,但是--我注意到您的请求XML丢失--这是RequestRecipientToken请求中的必需元素。这就是我的解决方案。用户名的格式必须为“[IntegratorKey]username”。这就是我的解决方案。用户名的格式必须为“[IntegratorKey]用户名”