Click or drag to resize

Transmitter5GetStatusFromDeclareSalary Method

Retrieve the status associated with a previous call to DeclareSalary(XmlDocument, XmlDocument, XmlDocument, XmlDocument, String, DateTime)

Namespace: SwissDecTX
Assembly: SwissDecTX.Transmitter5 (in SwissDecTX.Transmitter5.dll) Version: 5.0.0.0 (5.0.0.0)
Syntax
public void GetStatusFromDeclareSalary(
	XmlDocument xmlDoc,
	string jobKey,
	out XmlDocument result,
	out XmlDocument messageSent,
	out XmlDocument messageReceived,
	out XmlDocument plausibility,
	out bool jobFinished
)

Parameters

xmlDoc  XmlDocument
The original salary declaration previously sent using DeclareSalary(XmlDocument, XmlDocument, XmlDocument, XmlDocument, String, DateTime). Only the <RequestContext> and <Job> or <JobMonthTotal> parts are required so you could pass a shortened version of the original data. The transmitter retrieves the request ID from the original declaration and automatically adds a suffix to it, to satisfy the requirement that states that a new request ID must be used with every call. If your application creates and passes an ad-hoc <RequestContext> block (instead of passing the entire original declaration) you can use an asterisk (*), the empty string "" or the string "reqId" and the function will create a new request identifier for you. Of course if the original declaration already used the auto-generation feature and still contains "*", "" or "reqId" then there is nothing special to do. If you set a request ID yourself in the block you created, the transmitter still appends a suffix to it.
jobKey  String
The job key returned for that declaration by DeclareSalary(XmlDocument, XmlDocument, XmlDocument, XmlDocument, String, DateTime)
result  XmlDocument
The server's reply, contains the result of the operation or any error that might occur during the validation, transmission and processing of the salary declaration.
messageSent  XmlDocument
The signed message, just before it was encrypted and sent. This message is different from the one that was sent previously with DeclareSalary(XmlDocument, XmlDocument, XmlDocument, XmlDocument, String, DateTime). To be saved in the transmission journal.
messageReceived  XmlDocument
The signed raw server reply just after decryption. To be saved in the transmission journal.
plausibility  XmlDocument
The plausibility of the declaration, as returned by the server.
jobFinished  Boolean
A flag returned by the server indicating the status of the declaration job.
Remarks
If the <RequestID> tag contains a single asterisk character "*", the empty string "" or the string "reqId", this method will generate a unique identifier for you automatically (you need to parse the messageSent text to figure out the request ID that was created, or parse the server response). A valid SwissDecTX license is required to execute this method call.
Example
Calling Transmitter.GetStatusFromDeclareSalary()
   using SwissDecTX;

// ...

       try {

           var tx = new Transmitter5();

           bool jobFinished;
           XmlDocument result, messageSent, messageReceived, plausibility;

           tx.GetStatusFromDeclareSalary(xmlDoc, jobKey, out result, out messageSent, out messageReceived, out plausibility, out bool jobFinished); // xmlDoc and jobKey declared elsewhere

           // TODO: use messageSent, messageReceived, plausibility and jobFinished, else check result. Note that you must re-issue this call (retry) if the returned plausibility contains a single <ValidityPlausibilityChecking> node.

       } catch (Exception ex) {

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

       }
See Also