Closed m-imran38 closed 1 year ago
Hello, thanks for reporting this!
To help us troubleshoot this, would you mind providing us with a bit more information:
await
keyword in front of each function call. Any outer method wrapping our library function calls will also need to be asynchronous to execute properly.Thanks in advance for helping us help you!
Hello, thanks for the response.
This is an ASP .NET web application and MVC framework, i am calling the API in a class and my method is async. Following is the screenshot of the method.
[image: image.png]
I have called the API with and without the following line of code but same result: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
If you need any further information then let me know, if there is some specific configuration that i have missed then also help me regarding that.
Thanks
On Fri, Feb 10, 2023 at 10:40 PM Nate Harris @.***> wrote:
Hello, thanks for reporting this!
To help us troubleshoot this, would you mind providing us with a bit more information:
- What platform are you running our library on? Is this, for example, an ASP.NET application, a backend system?
- What does the outer code that calls the code snippet you shared look like? Since the last version you used, 2.5, the library has made asynchronous, as denoted by the await keyword in front of each function call. Any outer method wrapping our library function calls will also need to be asynchronous https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/async-await-best-practices-in-asynchronous-programming#async-all-the-way to execute properly.
Thanks in advance for helping us help you!
— Reply to this email directly, view it on GitHub https://github.com/EasyPost/easypost-csharp/issues/404#issuecomment-1426132125, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOEFCGQVCMYAELTE36EMXTWWZ4PBANCNFSM6AAAAAAUXTFXK4 . You are receiving this because you authored the thread.Message ID: @.***>
Sorry @m-imran38 , it looks like the image you tried to attach didn't get uploaded, would you mind sending it again?
The screenshot was inline, anyway i have attached it again.
[image: image.png]
On Sun, Feb 12, 2023 at 4:43 AM Nate Har
ris @.***> wrote:
Sorry @m-imran38 https://github.com/m-imran38 , it looks like the image you tried to attach didn't get uploaded, would you mind sending it again?
— Reply to this email directly, view it on GitHub https://github.com/EasyPost/easypost-csharp/issues/404#issuecomment-1426900072, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOEFCGO72H2LOFGSNKMWIDWXAPYPANCNFSM6AAAAAAUXTFXK4 . You are receiving this because you were mentioned.Message ID: @.***>
@m-imran38 It doesn't seem like GitHub automatically adds photos when responding via email, you might have to respond on the GitHub page directly for the attachment to work.
@m-imran38 Thank you for the image. Personally, nothing is immediately jumping out to me as an issue, but if you wouldn’t mind, could you confirm a few things for us to help us debug?
Thank you again for helping us figure this out.
Yes, the API key is passed as you can see in the screenshot, and whichever method I called there is no exception and no response.
here is the debug session of the api call.
Thank you for confirming those details, and for the video, very helpful to see it in action.
The only thing I can see is, the sync_shipment_accounts
function is marked asynchronous, but it is being called asynchronously upstream? Is it being called as await sync_shipment_accounts(storeId)
?
Other than that, you might be able to enter into the EasyPost library (go into the All()
function) and narrow down where in that function things are stalling.
Hopefully we can figure this out!
Thank you for your help I am able to figure out the issue and able to fix it and it is working now. This was the issue: "Is it being called as await sync_shipment_accounts(storeId)".
Glad we could figure it out!
Software Version
4.3.0
Language Version
.NET Framework 4.8
Operating System
Windows 11
What happened?
string apiKey = System.Environment.GetEnvironmentVariable(API_Key_EP)!; EasyPost.Client client = new EasyPost.Client(apiKey); List<CarrierAccount> carrierAccounts = await client.CarrierAccount.All();
In the code above, the code "await client.CarrierAccount.All()" does not give any response ...What was expected?
API call should give any response either success or error.
Sample Code
Relevant logs
No response