Azure Service Bus trigger tutorials - C# Library API Reference

Namespace

Appresso.DataSpider.Service

Class

AppFabricTriggerService


Class for sending a message to Azure Service Bus trigger a class to fire the trigger.
If you pass a value to a script input variable, set the value for an instance of this class.
After sending the message, gets an instance of ExecutionResponse class to hold the results of running the script from this class .

Members exposed by the AppFabricTriggerService type is as follows.

Constructor
public AppFabricTriggerService(string serviceNamespace, string servicePath, string defaultIssuer, string defaultKey)

Generate an instance of Azure Service Bus Service.
In Parameter, specify information for connecting to Azure Service Bus service which started Azure Service Bus trigger.

Parameter
  • serviceNamespace: Service Namespace (Service Namespace)
  • serviceNamespace: Service Path (Service Path)
  • defaultIssuer: Default Issuer (Default Issuer)
  • defaultKey: Default Key (Default Key)
Properties
public int RetrieveTimeoutSec

Get or set the timeout in seconds when receiving a message.
The default is 20 seconds.

Please set an integer from 1 to 120.
public int RetrieveRetryTimes

Get or set the number of retries to get messages.
The default is 10.

Please set an integer from 0 to 2147483647.
Methods
public ExecutionResponse Execute()

you send the message to Azure Service Bus trigger to fire trigger fire.
After processing the running script, blocks the process until it gets the running result message.
After receiving the message, returns an instance of ExecutionResponse which holds the running result content.

In this method, exception is raised when failing in connection with Azure Service Bus service.
See " The major exception "for more information.

Return value:
  • ExecutionResponse instance which retains the running result contents
public void PutParam(string key, string value)

Set the parameters transferred to the script input variable of type string.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • value: value to pass to script input variable of type string
public void PutParam(string key, int value)

Set the parameters to transfer to the script input variable in integer type.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • value: value to pass to script input variable of type integer
public void PutParam(string key, decimal value)

Set the parameters to transfer to the script input variable of type decimal.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • Value: the value to transfer to the script input variable of type decimal.
public void PutParam(string key, System, DateTime value)

Set the parameters to transfer to the script input variable of type time.
In this method, please be sure to call before from Execute method.
The value less than Ms digit is truncated.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • Value: the value to transfer to the script input variable of type time.
public void PutParam(string key, bool value)

Set the input parameters to transfer to the script input variable of type boolean.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • Value: the value to transfer to the script input variable of type boolean.
public void PutParam(string key, byte[] value)

Set the input parameters to transfer to the script input variable of type binary.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • Value: the value to transfer to the script input variable of type binary.
public void PutParam(string key, System.Xml.XmlDocument value)

Set the input parameters to transfer to the script input variable of type XML.
In this method, please be sure to call before from Execute method.

Parameter
  • key: key parameters.Please specify the one same as script input variable name which you cant to transfer value.
  • Value: the value to transfer to the script input variable of type XML.

ExecutionResponse


Class to store the running results of script.
You can get exit status and error information, script output variables from this class.

Members exposed by the ExecutionResponse type is as follows.

Properties
public int ExitStatus

Get the exit status.
For more information about the exit status, " refer to the concept of service development "for more information.
public bool Succeeded

Get whether the script was successfully executed.
public Dictionary<string, object> Results

In succeeding in execution of the script, get the Dictionary instance to retain the content of script output variable.

For the Dictionary of return value, instance type C# for type of script output variables as value, and script output variables name is retained as key. When you get the value, refer to " to get the script output variable "to cast type of target.
public ExecutionFailure Failure

If failing in running the script, get ExecutionFailure instance which hold the error content.

ExecutionFailure


This class stores the error information.

Members exposed by ExecutionFailure type are as follows.

Properties
public string Type

Gets the type of error that occurred.
public string Message

Gets the error message occurred.
public string Detail

Get the details of the error.