While performing callouts over Docusign API (here) from an Apex class it works fine. And whenever I try to introduce any Asynchronous callouts (future / batch) it generates an error.
I'm wondering why this is happening as there is only the difference of mechanism here. So, it works perfectly in a normal Apex call.
My Bussiness process to call the api has changed: I want to make callouts on record Update / Create / Delete event. So, Trigger is the only way I need to use. And to make callouts from a Trigger require an Asynchronous call (via future annotated with callouts=true). But this doesn't work for me currently.
So, I end up making this Business Process with 2 solutions (neither of them is working):
1). Apex Trigger -> Apex Class containing a future method annotated callouts=true.
2). Apex Trigger -> Apex Batch with Database.AllowsCallouts implementation
Following is the error I'm getting using Asynchronous call:
Web service callout failed: WebService returned a SOAP Fault: An Error Occurred during anchor tag processing. Invalid document faultcode=soap:Client faultactor=https://www.docusign.net/api/3.0/dsapi.asmx"
I’m pretty sure that this is Salesforce related error but I can’t fathom out why.