Berries encased in ice.

.Net Interface

This is a description of the interfaces that .Net clients (including PowerShell) use.

Data

There is a C# class for each SimTrans transaction—including the generic all-purpose transaction. The attributes are documented in the SimTrans manual from SigmaTEK. The main difference is that these classes include an attribute for a security token that is not recorded in the SimTrans documentation. For reference purposes, all the classes are installed in a data sub-folder of the client installation.

The data classes are included with:

using SimTransIF.Common;
                    

WebClient

The WebClient class is included with:

using SimTransIF.Client;
                        

Properties

string Host
Get or set the host name component of the server's URI.
int Port
Get or set the port component of the server's URI.
HttpStatusCode Status
Get the status of an HTTP operation. It is only defined after the execution of a send, get feedback or delete feedback operation.
string Result
Get the result of an HTTP operation. It is only defined after the execution of a send, get feedback or delete feedback operation.
string Token
Gets a security token to place in a SimTrans data transaction before sending it to the server. The get feedback and delete feedback operations automatically include the token.

Constructors

WebClient(Guid SharedId, string UriString = "", HttpClient Client = null, ILogger<WebClient> Logger = null)
Creates a WebClient instance. Technically, only the SharedId is required, but in practice, the UriString is also required in most cases.
Guid SharedId
The Guid that is placed in the ShardId attribute of the server's configuration.
string UriString
The full URI, including protocol and port to reach the server (e.g. https://server.domain:port). If it is not specified it defaults to https://localhost:5071, which is only suitable for local testing.
HttpClient Client
An HttpClient to use for the connection. If one is not specified, a new one is created and used.
ILogger<WebClient> Logger Logger
A logger to collect log messages from the web client. If none is specified, no log messages are output.

Methods

bool Send (string TransactionType, string JsonTransaction)
Synchronously sends a SimTrans transaction to the server. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties.
string TransactionType
This is the type of SimTrans transaction in the JsonTransaction parameter (e.g. "SN60", "SN7A", etc.). It is not case sensitive. For the genric transaction specify an empty string ("").
string JsonTransaction
The contents of the SimTrans transaction that corresponds to the TransactionType in Json format.
async Task<bool> SendAsync(string TransactionType, string JsonTransaction)
Asynchronously sends a SimTrans transaction to the server. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties.
string TransactionType
This is the type of SimTrans transaction in the JsonTransaction parameter (e.g. "SN60", "SN7A", etc.). It is not case sensitive. For the genric transaction specify an empty string ("").
string JsonTransaction
The contents of the SimTrans transaction that corresponds to the TransactionType in Json format.
bool GetFeedback (string FeedbackType)
Synchronously gets feedback from the specified SimTrans feedback table. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties. The result is a Json string containing an array of feedback rows. A security token is obtained automatically, so it is not necessary to submit one.
string FeedbackType
The SimTrans feedback table or type to get feedback from. Accepted values are {"pip", "PartsInProcess", "prg", "Programs", "prt", "CompletedParts", "rem", "Remnants", "sht", "Sheets", "wo", "WorkOrders"}. That values are not case sensitive.
async Task<bool> GetFeedbackAsync (string FeedbackType<)/code>
Asynchronously gets feedback from the specified SimTrans feedback table. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties. The result is a Json string containing an array of feedback rows. A security token is obtained automatically, so it is not necessary to submit one.
string FeedbackType
The SimTrans feedback table or type to get feedback from. Accepted values are {"pip", "PartsInProcess", "prg", "Programs", "prt", "CompletedParts", "rem", "Remnants", "sht", "Sheets", "wo", "WorkOrders"}. That values are not case sensitive.
bool DeleteFeedback (string FeedbackType, string JsonFeedback)
Synchronously removes the feedback, received from a previous GetFeedBack call, from the specified SimTrans feedback table. If only some of the returned rows are processed correctly on the client, then only those rows should be returned to be deleted. The others should remain to be retrieved and retried later. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties. A security token is obtained automatically, so it is not necessary to submit one.
string FeedbackType
The SimTrans feedback table or type to get feedback from. Accepted values are {"pip", "PartsInProcess", "prg", "Programs", "prt", "CompletedParts", "rem", "Remnants", "sht", "Sheets", "wo", "WorkOrders"}. That values are not case sensitive.
string JsonFeedback
The array of feedback rows returned from a previous GetFeedback call that were processed correctly on the client. These are the rows that are deleted.
async Task<bool> DeleteFeedbackAsync (string FeedbackType, string JsonFeedback)
Asynchronously removes the feedback, received from a previous GetFeedBackAsync call, from the specified SimTrans feedback table. If only some of the returned rows are processed correctly on the client, then only those rows should be returned to be deleted. The others should remain to be retrieved and retried later. It returns True if the operation succeeded; Otherwise False. The status and result are obtained from the corresponding properties. A security token is obtained automatically, so it is not necessary to submit one.
string FeedbackType
The SimTrans feedback table or type to get feedback from. Accepted values are {"pip", "PartsInProcess", "prg", "Programs", "prt", "CompletedParts", "rem", "Remnants", "sht", "Sheets", "wo", "WorkOrders"}. That values are not case sensitive.
string JsonFeedback
The array of feedback rows returned from a previous GetFeedback call that were processed correctly on the client. These are the rows that are deleted.

Examples

For examples, refer to the Examples page.