Skip to content

Running Your Connector

When developing a connector, it helps to be able to run your code on your local system completely separated from the Xchange app network and APIs that your connector would traditionally connect to during execution. We provide a series of tools to help make this process more smooth for the developer.

Prerequisites

When getting set up, its best to run through the following tutorial to make sure you have all your tools for development: Getting set up

Launch Settings Configuration

In your connector repository, if you open your solution, under the Connector project there is a file Properties/launchSettings.json which is a standard DotNet configuration file. More Information on it can be found here

This file gets copied to the output directory on build, but isn't compiled, so it doesn't trigger an automatic build from the IDE. After any modifications to this file you'll want to make sure to rebuild your solution/project.

In our scaffolding we provide two profiles that you can run to test different parts of your code. You are welcome to add profiles for ease of testing, or modify the existing profiles as needed to meet your testing needs. There are 6 parameters that can be used as the command line args for your profile to dictate what code paths will run.

Parameters

isLocal: This parameter is a boolean that defaults to false. If you want to run fully local development without communicating with the xchange test system (easiest set up for local development), it should be set to true.

moduleId: This parameter indicates which module we're testing when we're running inf fully local development. Local development only

serviceType: This parameter is for Local Development and indicates if you're running the cache writer for your module, or an action handler in your module. values are CacheWriter (default) or ActionProcessor. Local development only

dataObjectUrl: Used for testing an action processor. This parameter indicates the url part of the data object associated with the action you want to test. Local development only

actionUrl: Used for testing an action processor. This parameter indicates the url part for the action that you want to test the handler for. Local development only

Profiles

Profiles are a way to organize different methods of entry point to your connector.

Cache Writer Local Development

This profile is for testing your data readers for a module on your local system without any communication with the Xchange APIs.

For this profile, the only value that might need to change is the moduleId parameter, if you're not testing the default module.

The Command Line arguments for the profile would look like:

--isLocal true --moduleId app-1 --serviceType CacheWriter

Action Processor Local Development

This profile is for testing an action handler for your module on your local system without any communication with the Xchange APIs.

For this profile you may need to change the --moduleId parameter if you're not testing the default module. You also will want to make sure the --dataObject and the --action parameters match the url parts associated with your action and data object.

The Command Line arguments for the profile would look like:

--isLocal true --moduleId app-1 --serviceType ActionProcessor --dataObject project --action create