问题
I am trying to find envelop id status in DocuSign and getting error bad request http 400; Please verify below SOAP request.
<S:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="soap">
<S:Header>
<wsse:Security soap:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>XXXX</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">YYYY</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</S:Header>
<S:Body>
<ns0:RequestStatus xmlns:ns0="http://www.docusign.net/API/3.0">
<ns0:EnvelopeID>a7b6af7c-3a88-42e6-b454-42ccca6c879d</ns0:EnvelopeID>
</ns0:RequestStatus>
</S:Body>
</S:Envelope
Thanks, Shan
回答1:
The DocuSign SOAP API has two working endpoints that your integration can use:
- https://demo.docusign.net/api/3.0/dsapi.asmx
- https://demo.docusign.net/api/3.0/api.asmx
These two endpoints offer the same core platform functionality, the main difference is how they handle authentication. The /dsapi.asmx
endpoint requires SOAP UsernameToken auth whereas the /api.asmx
requires the custom X-DocuSign-Authentication header auth.
Since you are using the UsernameToken in your request can you confirm that you are pointing to the DSAPI endpoint?
For reference, here is a sample SOAP UsernameToken header:
<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp wsu:Id="Timestamp-0741d0e0-529f-49bc-bf86-653238d2532b">
<wsu:Created>2006-01-02T21:26:04Z</wsu:Created>
<wsu:Expires>2006-01-02T21:31:04Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-8d4e766e-a8a2-4bb3-a327-89c34bc7f85f">
<wsse:Username>caa26663-927b-4800-bfdf-d115d1c72f20</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
<wsse:Nonce>RumCR4p6U4a7hiX9lUlGWA==</wsse:Nonce>
<wsu:Created>2006-01-02T21:26:04Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
回答2:
Per SOAP DSAPI.ASMX and API.ASMX Endpoints, The main advantage of the DSAPI.ASMX endpoint is that it performs authentication using the X-DocuSign-Authentication header instead of the WSE3 UsernameToken.
As shown in the snapshot, You need to add header
as X-DocuSign-Authentication
with value
as <DocuSignCredentials><Username>dsuseremail@email.com</Username><Password>dsuserpassword</Password><IntegratorKey>hj******-****-****-****-**********09</IntegratorKey></DocuSignCredentials>
来源:https://stackoverflow.com/questions/48992240/docusign-http-400-bad-request