Asynchronous calls returning error

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.

Answer

I looked on Google, it appears someone else had the same issue over the DocuSign boards.

http://community.docusign.com/t5/DocuSign-API-Integration-Ruby-Salesforce-and-Other-READ-ONLY/The-problem-with-using-DocuSign-API-from-apex-class/td-p/19245

Looks like you need to use a different endpoint:

https://docusign.net/api/3.0/api.asmx

Attribution
Source : Link , Question Author : sanchit , Answer Author : Michael Welburn

Leave a Comment