Class ScraperResult
Information about a success or failure result, returned from scraper methods.
public sealed class ScraperResult
- Inheritance
-
ScraperResult
- Inherited Members
Remarks
A scraper method that is declared to return an instance of ScraperResult
must never return null. For convenience there are two static result instances
that indicate Subsembly.Scraper.ScraperResult.Success or Subsembly.Scraper.ScraperResult.Failure. The latter should rarely
be used, if at all. An implementation shall always try to return as much error
information as possible. As an additional convenience, the constructor
ScraperResult(Exception) can be used to easily convert runtime exceptions
to a ScraperResult.
Constructors
ScraperResult(ScraperResultChallengeType, string, byte[])
Creates a ChallengeResponseNeeded result.
public ScraperResult(ScraperResultChallengeType nChallengeType, string sDisplayText, byte[] vbChallengeData)
Parameters
nChallengeTypeScraperResultChallengeTypesDisplayTextstringvbChallengeDatabyte[]
ScraperResult(ScraperResultChallengeType, string, byte[], string)
Creates a ChallengeResponseNeeded result.
public ScraperResult(ScraperResultChallengeType nChallengeType, string sDisplayText, byte[] vbChallengeData, string sChallengeMimeType)
Parameters
nChallengeTypeScraperResultChallengeTypesDisplayTextstringvbChallengeDatabyte[]sChallengeMimeTypestring
ScraperResult(ScraperResultCode, string, string)
public ScraperResult(ScraperResultCode nCode, string sDisplayText = null, string sDiagnosticTrace = null)
Parameters
nCodeScraperResultCodeValue for Code.
sDisplayTextstringValue for DisplayText.
sDiagnosticTracestringValue for DiagnosticTrace.
ScraperResult(Exception)
public ScraperResult(Exception x)
Parameters
Fields
MIMETYPE_HHD13
Special value for ChallengeMimeType to indicate a ChipTAN challenge according to HHD 1.3.
public const string MIMETYPE_HHD13 = "application/x-hhd13"
Field Value
MIMETYPE_HHD14
Special value for ChallengeMimeType to indicate a ChipTAN challenge according to HHD 1.4.
public const string MIMETYPE_HHD14 = "application/x-hhd14"
Field Value
Properties
ChallengeAlternateLink
public Uri ChallengeAlternateLink { get; }
Property Value
ChallengeData
If the Code is ChallengeResponseNeeded, then this property provides the optional challenge data from the service.
public byte[] ChallengeData { get; }
Property Value
- byte[]
Remarks
The interpretation of this data blob depends on the actual
ChallengeType that is in effect. For some challenge/response methods
this might even be null.
ChallengeMimeType
If the Code is ChallengeResponseNeeded, then this property indicates the MIME-type of the challenge data, if any, this might even be 'null'.
public string ChallengeMimeType { get; }
Property Value
ChallengeResponseLabel
The text input label that shall be used to collect the ChallengeResponse from the user.
public string ChallengeResponseLabel { get; }
Property Value
Remarks
If this is not set by a particular implementation, then the default string "TAN"
is returned, so the returned string is never null.
ChallengeType
If the Code is ChallengeResponseNeeded, then this property indicates the type of challenge/response mechanism that is used.
public ScraperResultChallengeType ChallengeType { get; }
Property Value
Code
Success or failure code.
public ScraperResultCode Code { get; }
Property Value
DecoupledResponseNeeded
Indicates that a decoupled challenge response is needed.
public bool DecoupledResponseNeeded { get; }
Property Value
Remarks
This is true whenever Code is
ChallengeResponseNeeded,
and ChallengeType is NoTAN.
DiagnosticTrace
Diagnostic trace output to be captured in a log file.
public string DiagnosticTrace { get; }
Property Value
Remarks
This should not be displayed to the user, but should be available for supporting problems.
DisplayText
Error text to display to the user. This should be brief and carefully worded.
public string DisplayText { get; }
Property Value
Remarks
Although this is optional and may be null, it should always be set for
non-successful result. For a successful result it should be null.
IsSuccess
public bool IsSuccess { get; }
Property Value
QueryChoices
Optional list of choices from which the user can pick.
Only set if Code is QueryResponseNeeded.
If this is null, then the user should be able to enter arbitrary text.
public ScraperResultQueryChoice[] QueryChoices { get; }
Property Value
QueryFieldName
The name of the credential field, that must be supplied from a query. Only set if Code is QueryResponseNeeded.
public string QueryFieldName { get; }
Property Value
QueryHeading
Short heading text for the query. Only set if Code is QueryResponseNeeded.
public string QueryHeading { get; }
Property Value
QueryLabel
Optional label for query text input field. This is not used, when QueryChoices are provided.
public string QueryLabel { get; }
Property Value
QueryPrompt
Long prompt text to be presented to the user for a query. Only set if Code is QueryResponseNeeded.
public string QueryPrompt { get; }
Property Value
Methods
SetQuery(string, string, string, string, ScraperResultQueryChoice[])
public void SetQuery(string sQueryFieldName, string sQueryHeading, string sQueryPrompt, string sQueryLabel, ScraperResultQueryChoice[] vQueryChoices)
Parameters
sQueryFieldNamestringsQueryHeadingstringsQueryPromptstringsQueryLabelstringvQueryChoicesScraperResultQueryChoice[]