Integration Framework

 

Introduction

MetaField requires Integration Framework to utilize one or more services for the features it has, such as "DocuSign", or "Forney Integation".  As such, Integration Framework has many services that can be hosted on a server (for this wiki article, we assume the server is localhost) and then MetaField can call these services for CRUD operations for some of its specific features as mentioned before. These services are also called as "Provider Services".

Provider Service

The details of the Provider Services (in Integration Framework) are available in the Integration Framework Database as shown in the Figure:001. Please note that, only the providers which are active (IsActive=1) are hosted as WCF Services for serving their clients. The corresponding binaries for these provider services are available in the location that is configured in the App.config as shown in the Figure:002.

Figure:001

Figure:002

 

How are these provider services hosted?

The "IntegrationFramework.Host.Windows.Service" project in the "Integration Framework Solution" as shown in the Figure:003 is responsible for loading the active providers from the Integration Framework Database, loading their binaries from the configured location, and hosting them as WCF Services to serve their clients.

Figure:003

 

Listener Service

Listener Service (in MetaField) is hosted as a WCF Service that is called back from the Provider Service (in Integration Framework) in order to make some changes in the MetaField application (please note that, not all the provider services will require a listener WCF service. however, the Forney Provider Service requires it's listener service.). This means that there is a 2-way data exchange and manipulation between MetaField and Integration Framework. For example, MetaField calls the Forney Service (which is hosted as WCF Service in Integration Framework) for fetching the Forney Test Results data. This Forney Service, after fetching the Forney Test Results data, will call the Listener WCF Service in order to update the MetaData database with these test results data. This is illustrated in the Figure:004

Figure:004

 

How is the Listener WCF Service hosted?

The "MetaField.WebService" project in the "MetaField.All" solution as shown in the Figure:005 is used to host the Listener WCF Service which is used by the Forney WCF Service.

Figure:005

 

Steps to host the Provider Service (as WCF Service), and the Listener WCF Service

Host the Provider Service (Integration Framework) as WCF Service on localhost

Step 01: Open up the SQL Server Client application (SQL Server Management Studio or any application of your choice), and connect to the local Integration Framework database.

Step 02: Deactivate all the providers by executing the sql command "update Providers set IsActive = 0"

Step 03: Activate the only provider which you would like to test by executing the sql command "update Providers set IsActive = 1 where ID = {the ID of your Forney Provider Service}"

Step 04: Make sure that the provider settings are updated as seen in the Figure:006. For “User Name” and Password values, please connect with the Operations team.

Figure:006

 

Step 05: Make sure that the provider binaries are available in the configured location (refer Figure:002 for this configured location) as seen in the Figure:007

Figure:007

 

Step 06: If you already have not cloned the Integration Framework solution, please clone it from the bitbucket site (bit bucket (Agile Frameworks)https://github.com/AgileFrameworks ).

Step 07: Open Visual Studio in the Administrator mode, and then open the Integration Framework Solution, and then change to the latest branch and pull it.

Step 08: Right click on the project (Core ==> IntegrationFramework.Host.Windows.Service) and then click the "Set as Startup Project" option.

Step 09: Right click on the project (Core ==> IntegrationFramework.Host.Windows.Service) and then click the "Properties" option.

Step 10: Select the "Debug" tab from the left hand side menu.

Step 11: In the ("Start options" ==> "Command line arguments:") text box, add "--console", and then save the changes. Please refer Figure:008 for this information.

Figure:008

 

Step 12: Build the solution.

Step 13: Click the "Start" button on top to deploy this active provider as the WCF Service. Once the deployment is complete, you will see an open command prompt.

Step 14: Please do not press any button in this command prompt, else, the deployed WCF Service will be decommissioned.

Step 15: If you click http://localhost:8080/Forney.Braun.svc and you see a screen similar to the one in Figure:009 then, you are all set. Else fix the issues.

Figure:009

 

Now, your Forney Provider Service is deployed as a WCF Service on your localhost and the URL of this service is http://localhost:8080/Forney.Braun.svc (where Forney.Braun is the name of the provider).

Host the Listener WCF Service (MetaData) on localhost

Step 01: In order to host the Listener WCF Service on localhost, WCF and Internet Information Services (IIS) Features must be enabled on the localhost. Please refer Figure:010.

Figure:010

 

Step 02: There is no Forney Service that is setup for localhost where samples created on localhost can be tested and results fetched. So, connect to another environment, e.g., "USQATEST" to fetch the Forney Test Results data.

Step 03: Open Visual Studio in the Administrator mode, open the "MetaField.All" solution and update the "USQATEST" connection string in the web.config file of the "MetaField.Web" and "MetaField.WebService" projects.

Step 04: In the Solution Explorer, "MetaField.WebService" project ==> References ==> Delete "IntegrationFramework.Connector.dll".

Step 04a: In the Solution Explorer, "MetaField.WebService" project ==> Right Click on "References" ==> "Add Reference" ==> Browse to the Integration Framework solution ==> "Source\API\Connector\bin\Debug" folder ==> select "IntegrationFramework.Connector.dll" ==> OK.

Step 04b: In the Solution Explorer, scroll down to the project "MetaField.WebService", right click on it, and click the "Publish" option.

Step 05: In this screen, click the "Publish" button and wait for the project to be published into the file system.

Step 06: Now, the binaries and the supporting files like web.config for this project would have been deployed to the folder "C:/Projects/MetaField/Development/Deploy/WebService".

Step 07: Open up Internet Information Services (IIS), and then, Server ==> Sites ==> Right Click ==> Add Website.

Step 08: In the "Site name:" text box, enter "MF_ListenerWCFService".

Step 09: Click the "..." button under the "Physical path:" label, and then select the folder "C:/Projects/MetaField/Development/Deploy" and click "OK".

Step 10: Select Binding ==> Type ==> https.

Step 11: Select "SSL certificate" ==> "IIS Express Development Certificate" and then click the "OK" button.

Step 12: Click on Server ==> Sites ==> MF_ListenerWCFService. Make sure that in the middle bottom of the screen, "Features View" tab is selected.

Step 13: In this middle bottom portion of the screen, double click on IIS ==> Authentication and then enable "Anonymous Authentication". Disable all the other authentication mechanisms.

Step 14: Click on Server ==> Sites ==> MF_ListenerWCFService ==> WebService, and then switch to the "Content View" in the middle bottom portion.

Step 15: Right click on "Service.svc", and then click the "Browse" option. If you see a screen similar to the one in Figure:011 then, you are all set. Else fix the issues.

Figure:011

 

Now, your Listener WCF Service is deployed on your localhost, and the URL of this WCF Service is https://localhost/WebService/Service.svc

Steps to debug the Forney data retrieval for a sample created and tested on “USQATEST” environment using the WCF Services hosted on localhost

Debug the Forney Data Retrieval Code

Step 01: There is no Forney Service setup for localhost where samples created on localhost can be tested and results fetched. So, connect to the "USQATEST" environment to debug the Forney test results data retrieval code.

Step 02: In one of the previous steps to deploy the Listener WCF Service, we have already updated the connection string to point to the "USQATEST" environment.

Step 03: Open Visual Studio and open the "MetaField.All" solution.

Step 04: In the Solution Explorer, "MetaField.Web" project ==> References ==> Delete "IntegrationFramework.Connector.dll".

Step 05: In the Solution Explorer, "MetaField.Web" project ==> Right Click on "References" ==> "Add Reference" ==> Browse to the Integration Framework solution ==> "Source\API\Connector\bin\Debug" folder ==> select "IntegrationFramework.Connector.dll" ==> OK.

Step 06: Perform Step 04: and Step 05: for the project "MetaField.Objects".

Step 07: In the Solution Explorer, "MetaField.Web" project ==> Right Click ==> "Set as Startup Project", and then select "Debug" on the top of the IDE below "Debug" menu option.

Step 08: In the "MetaField.Objects" project ==> Helpers ==> Extension.cs file, make changes in the methods "ToCustomerSubdomain" and "ToCustomerDomain" as found in Figure:012.

Figure:012

 

Step 09: Please note that the changes done in the previous Step 08: is with respect to the customer whose Alias and DomainName are as per Figure:013. If you are using a different customer then, update the code accordingly.

Figure:013

 

Step 10: In the "MetaField.Objects" project ==> Repositories ==> IFRepo.cs file, make changes in the constructor "IFRepo" as found in Figure:014.

Figure:014

 

Step 11: In the "MetaField.Web" project ==> Areas ==> LIMS ==> Models ==> ConcreteGroutMortar ==> WorkQueueModel.cs file, make changes in the method "RetrieveForneyPrismData" as found in Figure:015.

Figure:015

 

Step 12: After these changes, please build the solution, and also deploy the Listener Webservice (with USQATEST connection string and DefaultClientAlias) once again.

Set up the debug points wherever you want in the code.

Step 13: Click the Debug menu option and then LIMS ==> "To Test" ==> "Grout Prism" ==> Select a sample ==> Click the "Enter Test Results" button.

Step 14: In this screen, click the "Retrieve Forney Data" button.

Step 15: You will see the debug points are hit and after continuing, Forney Test Results data is retrieved.