25
It would be great if codeunits could be published as Restful Web Services instead of being forced to saop.

If you currently want to publish a (complex) function in a codeunit via a web service, this is only possible as a SOAP service. However, many software products nowadays only have interfaces for REST, so it would be helpful if BC could provide a RESTful web service directly.
Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.

Best regards,
Business Central Team

Comments

J

Julius,

The main issue behind these web services is the fact that codeunits are environment specific (not company specific). If you look at queries and pages, you will see this structure:
https://api.businesscentral.dynamics.com/v2.0/{{Tenant}}/{{Environment}}/ODataV4/Company('{{Company}}')/{{WebService}}

The Company section of this URL is irrelevant to the Codeunit in that there is only one Codeunit across all companies. With that said, records have to be scoped to the appropriate company.

If you call a **specific method** of a codeunit, you can call the codeunit webservice with the following request:

https://api.businesscentral.dynamics.com/v2.0/{{Tenant}}/{{Environment}}/ODataV4/{{WebService}}_{{CodeunitMethod}}?company={{Company}}

The company is a header parameter to the URI.

It would be nice if the URI's had uniform structures between pages, queries, and codeunits.


Sincerely,
Kieran Sweeney

Category: Development

J

Thanks for your answer.
I know bound actions and have implemented my service with bound actions and also with SOAP, but in both cases I have all this additional meta information that I don't want. What I want is a simple rest service...

Category: Development