Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Custom Code Device allows you to add embedded resources which can be accessed from your source code. To add a resource to your project, right-click the Resources item and select Add Resource. Select the file(s) to include in your project and click Open.

 

 

 

Note

Embedded resources become part of the Custom Code Device configuration, allowing them to be part of exported channel files and templates. The Connexion client application does inspect the channel configurations frequently during operation, and large resource will slow down channel management. Ideally, large files accessed by your code should not be added as resources, but instead accessed as external files.

 

 

To access resources, use the following syntax: 

Image Modified 

To remove an existing resource, right click the resource to remove and select Remove Resource.

Using code files

The Custom Code Device supports multiple code files, allowing you to separate your code as desired. To add a new code file, right-click the code item and choose Add Code File. You can rename your code file by left-clicking the code file name while that item is already selected (similar to Windows Explorer).

Note

The Custom Code Device requires one code file defining your custom device. It must implement the BaseCustomDevice, be named CustomDevice, and be defined in the Connexion.

...

 

Using code files

 

...

Device namespace.

Image Added

To remove an existing code file, right click the code file to remove and select Remove Code File.

Using the sample devices

Connexion ships with template channels showing the custom code device being used to:

  • Access SOAP web service functionality.
  • Access REST web service functionality.
  • Host a SOAP web service.
  • Host a REST web service.

See Loading Templates in the main help file for information about loading channel templates.