Creating the service layer
As described in the architectural diagram of our solution, we don't want to directly expose the NAV web services (business logic) to an external application. We want to create a WCF service that will be something like an integration layer between NAV and the B2B application. This will permit us to have the following things:
NAV objects (
Query
andCodeunit
) and their methods not directly published to the B2B websiteCustom authentication from the B2B application to access the business functions
Custom methods exposed to the B2B application, not directly binded to the NAV entities, with the possibilities to use protocols such as XML or JSON
The information's flow will be as represented in the following diagram:
Let's start to write the WCF service now by perfomring the following steps:
Open Visual Studio, select the WCF template, and go to File | New | Project… | WCF Service Application in order to create the project solution.
We want to create a WCF service that is able...