Click or drag to resize

DirectCommandsSendXmlCommandAsync Method

Linkar Framework for .NET and Core


Allows a variety of asynchronous direct operations using standard XML templates, asynchronously only.

Namespace: Linkar.Commands
Assembly: Linkar.Commands (in Linkar.Commands.dll) Version: 2.3.1
Syntax
public static Task<string> SendXmlCommandAsync(
	CredentialOptions credentialOptions,
	string command,
	int receiveTimeout = 0
)

Parameters

credentialOptions  CredentialOptions
Object with data necessary to access the Linkar Server: Username, Password, EntryPoint, Language, FreeText.
command  String
Content of the operation you want to send.
receiveTimeout  Int32  (Optional)
Maximum time in seconds that the client will wait for a response from the server. Default = 0 to wait indefinitely.

Return Value

TaskString
The results of the operation.
Example
using Linkar;
using Linkar.Commands.Direct;

class Test
    {
        public string MySendCommand()
        {
            string result = "";
            try
            {
                CredentialOptions credentials = new CredentialOptions("127.0.0.1", "EPNAME", 11300, "admin", "admin");
                string command = 
                    "<COMMAND NAME=\"READ\">" +
                    "   <CALCULATED>True</CALCULATED>" +
                    "   <OUTPUT_FORMAT>XML_DICT</OUTPUT_FORMAT>" +
                    "   <FILE_NAME>LK.CUSTOMERS</FILE_NAME>" +
                    "   <RECORDS>" +
                    "       <RECORD>" +
                    "           <LKITEMID>2</LKITEMID>" + 
                    "       </RECORD>" +
                    "   </RECORDS>" +
                    "</COMMAND>";
                result = DirectCommands.SendXmlCommandAsync(credentials, command).Result;
            }
            catch (Exception ex)
            {
                string error = ex.Message;
                // Do something
            }
            return result;
        }
    }
See Also