Click or drag to resize

Transmitter5PingString Method

Verifies that the SwissDec Web Service is reachable, as required by test-case UC010. This method transmits the "Hello, World!" string to the server, using clear text transmission (no digital signature and no encryption).

Namespace: SwissDecTX
Assembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
Syntax
public void PingString(
	string appVersion,
	string monitoringID,
	out string serverTime,
	int lcid
)

Parameters

appVersion  String
UserAgent/Version as it appears in your declarations.
monitoringID  String
Your monitoring ID. Contact SwissDec to obtain your own private monitoring ID. You can use "monitoringID" or "tester" as a generic ID of you don't have your own yet.
serverTime  String
Contains the server's time upon return from the call. Formatting depends on the lcid.
lcid  Int32
The locale identifier (see http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx) that tells the transmitter how to convert to/from date/time string representation. Use 1033 (hexadecimal 0x409) for US-English convention, 4108 for fr-CH, 2064 for it-CH and 2055 for de-CH. If you pass 0 the conversion will be made according to the current culture.
Remarks
This method will throw an exception in case an error occurs, or if the echoed string does not match the sent string.
Example
Calling Transmitter.Ping()
   using SwissDecTX;

// ...

       try {

           var tx = new Transmitter5();

           string serverTime;
           tx.PingString(appVersion, monitoringID, out serverTime, 4108); // fr-CH = 4108, de-CH = 2055, it-CH = 2064

       } catch (Exception ex) {

           MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

       }
See Also