docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
129 stars 159 forks source link

DocuSignClient.InterceptRequest and DocuSignClient.InterceptResponse never invoked by EnvelopesApi [v. 6.5.0] #414

Closed cpr-slifland closed 9 months ago

cpr-slifland commented 1 year ago

I'm in the process of updating my product's dependency on a v 5.x version of the SDK. I support the deprecation of RestSharp, but in the process it seems the SDK broke the InterceptRequest and InterceptResponse methods of DocuSignClient.

After making the changes required to migrate to v 6.x, those methods are never invoked. I've examined the decompiled code for the DocuSign SDK and they do not appear to be called by EnvelopesApi.

cpr-slifland commented 1 year ago

I looked through your source code and it looks like the calls to InterceptRequest and InterceptResponse are present but commented out with no explanation. Can these be restored?

https://github.com/docusign/docusign-esign-csharp-client/blob/f0ada4407b9a4d6e3942d0b753d981c1ea8893ca/sdk/src/DocuSign.eSign/Client/DocuSignClient.cs#LL244C41-L244C41

mike-mej commented 1 year ago

Greetings,

I appreciate your message to DocuSign Developer support. We will investigate about this.

cpr-slifland commented 1 year ago

Hello, has there been any progress on this? It seems like it should be an easy change and it is blocking me from using the current version of your SDK.

mike-mej commented 1 year ago

Hello, our team is working on this, but we don't have an ETA yet.

Sudharsan-Narayanasamy commented 1 year ago

@slif-cpr - I've just started on the new version of the SDK as well and wondering how are you using DocuSignClient ? Do you use the CallApiAysnc method to make calls to DocuSign ? Or, expose the DocuSignClient to other classes like EnvelopesApi ?

Which one is ideal based on your experience.

cpr-slifland commented 1 year ago

Hi @Sudharsan-Narayanasamy,

We are still using version 5.6.0 of the SDK. I believe DocuSignClient was introduced in a later version. We defined a subclass of ApiClient to override InterceptRequest and InterceptResponse, and then we always provide an instance of that client when initializing EnvelopesApi to make API calls. Let me know if that doesn't answer your question

Sudharsan-Narayanasamy commented 1 year ago

Thank you @slif-cpr for quick response. It does answer my question and now I have few more :)

Do you use dependency injection for EnvelopesApi ? InterceptRequest is where you add the token ? Also, have you used RequestJWTApplicationToken ?

cpr-slifland commented 1 year ago

Hi @Sudharsan-Narayanasamy, sorry I have not had a chance to respond sooner.

When we instantiate EnvelopesApi, we pass in our custom subclass of ApiClient that overrides InterceptRequest and InterceptResponse, so yes, I suppose we're using dependency injection.

We are only using InterceptRequest and InterceptResponse for logging. We add the token to the default headers when we instantiate the ApiClient subclass.

We are using APIClient.RequestJWTUserToken - haven't checked how that differs from RequestJWTApplicationToken.

ugrdtr2312 commented 1 year ago

Our team has also faced this issue.

@InbarGazit Could you please take a look at it?

cpr-slifland commented 10 months ago

Hi @Sudharsan-Narayanasamy, does your team have any update on when this issue is expected to be resolved?

kenharris commented 10 months ago

Hi @slif-cpr @ugrdtr2312, this issue should be resolved in version 6.6.0 of the NuGet package that was released today.

kenharris commented 9 months ago

Closing due to fix