Class SY_SDataServer

This class is the primary ProvideX piece of the SData provider. When the C# SData adapter needs something to be handled in ProvideX, it runs a short ProvideX program which interacts with an instance of this class. Only one instance of this class is needed per ProvideX session. Reuse the same instance of this class until the SData provider is stopped or until an important configuration change needs to be reflected. This class may cache information for performance purposes, but every public method must behave as if this class were stateless. This is why we pass information on the call stack and minimize the number of class variables.

Properties

PROPERTY HttpStatusCode   * Read Only *

The numeric HTTP Response Code resulting from the last ServeXXX method. Read-only.

PROPERTY HttpResponseBody$   * Read Only *
The text response resulting from the last ServeXXX method. Read-only.

Methods

FUNCTION ConnectionStringTemplate$()  

Provides the .NET adapter with information it can use to connect directly to the database.

Returns [string]. First three or four characters are "SQL" or "ODBC" indicating the type of database. For "SQL" the rest is the SQL Server containing the databases. For "ODBC" the rest is an ODBC connection string. Substitute appropriate values for UID=, PWD=, Company=, and Server=.
FUNCTION ServeCheckSelect(credentials$, company$, resourceName$)  

Checks security for reading.

ParameterDescription
credentials$ [input, string] Username and password, separated by a semicolon
company$ [input, string] Company code
resourceName$ [input, string] Name of the resource being requested
Returns nothing. Check HttpStatusCode and HttpResponseBody$ properties for results.
FUNCTION ServeCreate(credentials$, company$, resourceName$, properties$)  

Creates new data.

ParameterDescription
credentials$ [input, string] Username and password, separated by a semicolon
company$ [input, string] Company code
resourceName$ [input, string] Name of the resource being created
properties$ [input and output, string] Special serialized string representation of the data to be created (input) and that was created (output)
Returns nothing. Check HttpStatusCode and HttpResponseBody$ properties for results.
FUNCTION ServeDelete(credentials$, company$, resourceName$, whereProperties$)  

Deletes data.

ParameterDescription
credentials$ [input, string] Username and password, separated by a semicolon
company$ [input, string] Company code
resourceName$ [input, string] Name of the resource being deleted
whereProperties$ [input, string] Special serialized string describing the data to be deleted
Returns nothing. Check HttpStatusCode and HttpResponseBody$ properties for results.
FUNCTION ServeGetTemplate(credentials$, company$, resourceName$, properties$)  

Retrieves a resource template

ParameterDescription
credentials$ [input, string] Username and password, separated by a semicolon
company$ [input, string] Company code
resourceName$ [input, string] Name of the resource that a template is being requested for
properties$ [output, string] Special serialized string representation of the resource template
Returns nothing. Check HttpStatusCode and HttpResponseBody$ properties for results.
FUNCTION ServeUpdate(credentials$, company$, resourceName$, properties$, whereProperties$)  

Updates existing data.

ParameterDescription
credentials$ [input, string] Username and password, separated by a semicolon
company$ [input, string] Company code
resourceName$ [input, string] Name of the resource being updated
properties$ [input and output, string] Special serialized string representation of the data to be updated (input) and that was updated (output)
whereProperties$ [input, string] Special serialized string describing the data to be deleted
Returns nothing. Check HttpStatusCode and HttpResponseBody$ properties for results.

Properties inherited from: SY_SDataConstant

constSpecialResourceSuffix$, constSpecialResourceSuffix2$, constMaxFieldLength, constMaxTableNameLength, constResourceTypeLength, retHttpOK, retHttpCREATED, retHttpBADREQUEST, retHttpUNAUTHORIZED, retHttpFORBIDDEN, retHttpNOTFOUND, retHttpCONFLICT, retHttpGONE, retHttpPRECONDITIONFAILED, retHttpINTERNALSERVERERROR, retHttpSERVICEUNAVAILABLE, resourceTypeSIMPLE$, resourceTypeDETAIL$, resourceTypeDISTRIBUTION$, resourceTypeSY_SalesTaxSchedule$, resourceTypeSY_SalesTaxScheduleDetail$, resourceTypeAP_ManualCheckDetail$, resourceTypeAP_ManualCheckInvDetail$, resourceTypeSO_SalesOrderPayment$, resourceTypeSO_InvoicePayment$, resourceTypeIM_TransactionDetail$, resourceTypeIM_TransactionTierDist$

Methods inherited from: SY_SDataParser

Contains(), CreatePropertyString(), ParsePropertyString(), AppendFieldsAndValues(), CreatePropertySubstring(), DetermineSeparator(), ParsePropertySubstring()