HOWTO USE STM SERVICE TEMPLATE HOWTO Use STM

  • Slides: 12
Download presentation
HOW-TO USE STM SERVICE TEMPLATE

HOW-TO USE STM SERVICE TEMPLATE

HOW-TO Use STM Service Template This HOW-TO describes how STM Service Template can be

HOW-TO Use STM Service Template This HOW-TO describes how STM Service Template can be used to connect services and applications to Sea. Swim.

STM Service Template The STM Service Template is a Visual Studio C#. NET multi-project

STM Service Template The STM Service Template is a Visual Studio C#. NET multi-project template that simplifies the development needed to connect any application service To Sea. Swim. The template comprises three VS projects, Contract, Data. Access and a Web. Api for interaction with VIS acts as the frontend of the application service and through this VIS instance public interface, external users can communicate with the application service using the four different STM payloads; RTZ, S 124, TXT and PCM. The application service, here called the backend, interacts with its VIS by consuming the VIS private REST interface. The private side follows the VIS Private REST Technical Design that can be found on Developer Forum. http: //s 3 -eu-west-1. amazonaws. com/stm-stmvalidation/uploads/20170403113238/VIS-REST-Design-Private-STM-Project_v 2. 2 -. docx

STM Service Template The interaction between VIS and the application service might follow this

STM Service Template The interaction between VIS and the application service might follow this sequence: 1. A STM message is uploaded to VIS 2. VIS notifies the application service by consuming the Notify interface 3. The application service is then triggered by its own controller and starts by calling VIS private Get. Message() interface 4. The processing of the STM message can now start 5. The application service might have a return message that needs to be sent to the origin caller. This is done by consuming its VIS private Call. Service() interface

STM Service Template in technical context VIS Instance App Service Private side Public side

STM Service Template in technical context VIS Instance App Service Private side Public side S S C Examples of existing app services that are fronted by a VIS: • SMA Nordic Pilot Route Service • SMHI Optimisation Service • SMA ETA Service • SMA MSW Service • SMA SRS Service Sea. SWIM (internet) Public side S S C

STM Service Template usage 1. Save the. zip file in your Visual Studio Project.

STM Service Template usage 1. Save the. zip file in your Visual Studio Project. Template folder. By default this directory is %USERPROFILE%DocumentsVisual Studio <version>TemplatesProject. Templates. 2. Start Visual Studio and create a new Project by choosing the added template. 3. Build the solution to restore all Nuget packages 4. The solution comprises three projects: – <your namespace>. Contract All data classes needed for interacting with STM – <your namespace>. Data. Access An example of your business data models and database context – <your namespace>. Web. Api Provides interfaces between VIS and your business backend 5. Make changes to adopt your service backend

1. Save the. zip file Example of a file location where to save the

1. Save the. zip file Example of a file location where to save the STMTemplate. zip file

2. Create a new Project 2. 1 After saving the compressed template file in

2. Create a new Project 2. 1 After saving the compressed template file in your VS installation directory according to point 1. , start a new instance of Visual Studio 2. 2 Create a new project and choose the STM Service Template 2. 3 Name your root namespace (in this example it is named by default to STM Service 1)

3. Build solution 3. 1 Build solution to restore all Nuget packages 3. 2

3. Build solution 3. 1 Build solution to restore all Nuget packages 3. 2 Verify that your chosen namespace is added

4. Verify projects 4. 1 Verify that there are three projects added to the

4. Verify projects 4. 1 Verify that there are three projects added to the solution

5. Adopt solution to your service Changes are needed in • Data. Access –

5. Adopt solution to your service Changes are needed in • Data. Access – Change to your data model, entities and dbcontext etc • Web. Api – Factory, classes for business specific logic – Models, classes for business data contracts – Services • • Message. Sender serves only as an example of a sender component, change this to your needs Vis. Service is a façade for the VIS private interface and can be left as built