3rd Party Runtime Hosting tutorial
Sending an SMS message through an ASP .NET SOAP Client to update a table Demonstrating the use of C# to create Virtuoso hosted Stored Procedures and Triggers. In this demo the database events trigger SMS messages that are relayed via C# based SOAP Client.

## Overview

The following tutorial demonstrates how a C# based Managed SOAP Client is used to create SMS based database notification services inside Virtuoso. This demo executes a database trigger every time a new Supplier record is added, updated or deleted. In this example a C# class acts as a SOAP client to a 3rd party XML Web Service that provides the SMS (Short Message Services) delivery to mobile phones. Note, this demo will work with any phone that is capable of receiving SMS (TEXT) messages.

## Prerequisites

This demo currently works only on a Virtuoso server running under Microsoft Windows with following components installed:

- Windows
  - .NET Runtime and Frameworks
  - .Net Runtime and Framework SDK (if you seek to write your own Objects for integration with Virtuoso)
  - Virtuoso Universal Server for Windows with .NET CLR Hosting.

## Tutorial Example

Please follow the steps below to maximize the value of this tutorial:

1. Click on the "Set Initial State" link which registers the "redcoalsmssvc" service with Virtuoso. Click on the "ho_s_3.sql" link to see the code behind this step
2. Click on the "Run" links to actually experience the demo

Demo Breakdown

1. "ho_s_3.sql" performs the following steps
   1. Registers the "redcoalsmssvc" class with Virtuoso. Click on the "redcoalsms.cs" and "redcoalsmsref.cs" links to see the C# source code. Note that the class "redcoalsmssvc" is part of an assembly that has the namespace "redcoalsms"
   2. Creates the "Suppliers" table
   3. Creates a stored procedure "redcoal_send_sms" which demonstrates the syntax for creating an instance variable which includes the assembly namespace in the type reference. Specifically, note the use of an underscore instead of a dot when making this assignment
   4. Creates a Trigger named "send_sms_to_mgr_new_supp" that sends an SMS message each time a new "Supplier" table record is inserted
   5. Creates a Trigger named "send_sms_to_mgr_mod_supp" that sends an SMS message each time a "Supplier" record is updated
   6. Creates a Trigger named "send_sms_to_mgr_mod_supp" that sends an SMS message each time a supplier record is deleted
2. "setup_sms.vsp" sets up all of the base data and verifies that SMS service connectivity required by this demo is available.
3. "handler.vsp" is the actual interface through which you add or delete supplier records which result in SMS notifications being sent to your mobile phone.