Getting error calling web service.

SuD
Member Posts: 102
Hi all,
I published a web service of type codeunit, and in this CU I wrote some functions in one function I wrote some code about calling a external API, and I m consuming that web service in my C# code.
But when the "GetResponse" function going to execute in C/AL I m getting exception in C#, below is the screen shot for error.

below is the screen shot of code, I could use AUTOMATION type variable for this code but in C# it will cause exception of type like dialog open, message box open etc. So I used DotNet var. May be I m wrong with code, please help me out.

Thanks in advance.
I published a web service of type codeunit, and in this CU I wrote some functions in one function I wrote some code about calling a external API, and I m consuming that web service in my C# code.
But when the "GetResponse" function going to execute in C/AL I m getting exception in C#, below is the screen shot for error.

below is the screen shot of code, I could use AUTOMATION type variable for this code but in C# it will cause exception of type like dialog open, message box open etc. So I used DotNet var. May be I m wrong with code, please help me out.

Thanks in advance.
0
Answers
-
Maybe the same problem as in :Calling Rest API.
Add the line: ServicePointManager.SecurityProtocol(SecurityProtocol.Tls12);0 -
Maybe the same problem as in :Calling Rest API.
Add the line: ServicePointManager.SecurityProtocol(SecurityProtocol.Tls12);
where to add, in C/AL or in C#. How can I add it in C# because API is calling from NAV code, or if you are talking about adding line in C/AL then what Dot Net var should I use.
Thanks0 -
By your c#-code you skills are at zero, you may need some training there, then you may understand the Exception-class and what a message means.0
-
By your c#-code you skills are at zero, you may need some training there, then you may understand the Exception-class and what a message means.
Bro I m not a C# developer, That's why I post this error here, If you know how to resolve this error then please let me know, Otherwise I don't need your suggestions.
2
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions