xxServer

The xxServer Object allows you to send a transaction from the current JavaScript and receive the Response.
Makes the current JavaScript a client for the Server.

Constructor

var server = new xxServer(strTC);
var server = new xxServer(strTC, strHost, nPort);
var server = new xxServer(strTC, strHost, nPort, nTimeout);
  • strTC : String,  Transaction Control Data (XML) to be used on transactions.
  • strHost : String, IP or domain name of the server to use
  • nPort : Integer, port of the server to use
  • nTimeout : Integer, timeout of the transaction in seconds


Properties

PropertyDescription
ResponseString, Server response after the execution

 

Methods

MethodDescription
SendTransactionSend the Transaction to the XX1 Server

 

Comments

The calling Script represents the client for the new transaction.

 

Example

//Request to trigger the new Transaction
//e.g. Get information from other Provider
var newREQ="<otherProviderRQ><Transaction>...</Transaction></otherProviderRQ>";
//The Transaction Control Data, like the TC from the ClientRQ
var strTC = "<tc>"
          + "    <iden u='YOURUSER' p='YOURPASSWORD'/>"
          + "    <provider session='ANYSESSION'>otherProvider</provider>"
          + "    <trace>YOURTRACENAME</trace>"
          + "</tc>";
//New Instance of the Transaction Server
var server = new xxServer(strTC);
//Send transaction Request to Server;
if (server.SendTransaction(newREQ))
{
    // Get the Response back
    if(server.Response)
    {
        var newInfo = server.Response;
    }
    else
    {
        throw "No valid Server Response";
    }
}
else
{
    throw "Couldn't send transaction to Server";
}