Generating The National Weather Service Connector Code

Once you have started a new Integration Framework project using Visual Studio, a Wizard displays. Use the Wizard to configure some basic information for your new Connector. That configuration generates some base code for you to use in your Connector project. The information below illustrates how to configure the Wizard and the implications of that configuration in the context of the sample Weather project. When you have completed all three panels, click Build Project to create your Connector project in Visual Studio.

General Panel

In the General panel enter information that is related to registering the Connector. The Wizard automatically generates a new ID to use for the Connector Type Id in the TIBCO Scribe® database. This is the unique identity of the Connector type.

Authentication Panel

Authentication configures information displayed by the Connector in the TIBCO Scribe® Connection dialog and how that information is used to establish a valid connection to the data source. The National Weather Service is unusual because its API is open and does not require credentials. However, the Integration Framework requires that certain things be established in the connection to validate connection information and setup information used in subsequent calls.

To validate connection information the Integration Framework expects to make at least one HTTP call when connecting. If the connection information is valid, the Integration Framework expects to receive a successful status code in return.

To set up information used in subsequent calls to the API, a BaseUrl is required and is used as the root URI for all other calls. This information is common across all of the HTTP Requests that the Connector makes. For the sample Weather project there is only one call, but typically you can see a pattern containing a common part of the URI, and then different paths indicating access to different resources. When making calls the Integration Framework combines the BaseUrl with the path for a particular call.

For this sample project, there is no authentication, so we choose Custom, and allow the user to specify the BaseUrl in the connection form. Alternatively, you could remove the BaseUrl and hard-code the value in the Connector. This option may be simpler for the end user, but is more error prone. If the end user is tasked with entering the BaseUrl on the Connection dialog, make it clear in documentation exactly what part of the URL is expected.

Data Panel

The Data panel defines the data structure or type and data entities you want to access from the API or datastore. It also defines the operations you plan to perform, such as Create or Update. For the sample Weather project, we established that the data structure should be XML during the connection analysis. Make sure that XML is selected. See Analyzing The National Weather Service Connection.

We plan to access one entity called Weather. There are no operations that can be performed on this API, so those are not enabled in this project.

Once you have determined the entity or entities you want to access, enter the name in the Entity Name field. To access that entity, a relative path is also required. This is the path to be added to the BaseUrl to create a complete URL. To access the Weather entity, we need to add

/xml/sample_products/browser_interface/ndfdBrowserClientByDay.php

For this project, check Query to enable it, and then select None for Create and Update. The National Weather Service API does not allow us to create or modify data.

The Data section of the code requires mores configuration after running the Wizard. We need to define the structure of the data in this entity using the XML response from our connection analysis to help us. We also need to customize how the weather data is extracted from the payload of the HTTP Request. The Wizard gives us a good starting point.

Build The Project

When you have completed the configuration in the Wizard, click Build Project to generate the base code for your sample Connector. See Reviewing Sample National Weather Service Connector Generated Code to go over the code generated by the Wizard.

See Also

Reviewing Sample National Weather Service Connector Generated Code