Hi,
I was going to suggest a new publisher to be added in the Codeunit 1290 and, as it is correct to do, I did a research in the previous issues and i found exactly same request
https://github.com/Microsoft/AL/issues/1156?_pjax=%23js-repo-pjax-container
I'd like to open a discussion about how to call web services using AL.
I understood that with BC the plan was to use as much as we can standard code and extend it with events and extensions.
I appreciate that now in AL we have new types integrated
HttpClient | Provides a data type for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. |
HttpContent | Represents an HTTP entity body and content headers. |
HttpHeaders | Is a collection of headers and their values. |
HttpRequestMessage | Represents a HTTP request message. |
HttpResponseMessage | Represents a HTTP response message including the status code and data. |
This avoid us to load DotNet components during the declaration but what is the point to rewrite from scratch the code for every web call?
I think would be better optimize the extensibility of the codeunit 1290.
What is your option?
Please motivate your answers so that this discussion does not become a complain repository.
Thanks
Sergio
Agree 100% and suggested to the team lots of months ago. I think it could be interesting to have a codeunit that acts as a wrapper for performing web service or REST calls, in order to avoid writing always the same N lines of code.
The problem is that this codeunit/methods exposed must guarantee:
1) extensibility (we must be able to change the standard call by changing some parameters that can be different from ws to ws).
2) handle different authentication types
3) handle different types of calls