Table of Contents

Class PinpointFileServiceClient

Namespace
Acuit.Pinpoint.Services.Client
Assembly
Acuit.Pinpoint.Services.Client.dll

A client for the Acuit Pinpoint TCP SOAP file retrieval service.

public class PinpointFileServiceClient : PinpointClientBase<IPinpointFileService, PinpointFileServiceClientOptions>, IPinpointFileServiceClient, IPinpointFileService, IPinpointClient, IDisposable
Inheritance
PinpointFileServiceClient
Implements
Inherited Members

Constructors

PinpointFileServiceClient(PinpointFileServiceClientOptions)

Initializes a new instance of the PinpointFileServiceClient class.

public PinpointFileServiceClient(PinpointFileServiceClientOptions options)

Parameters

options PinpointFileServiceClientOptions

The client connection options.

Remarks

The client will be configured according to options, as well as:

  • TCP for message delivery, with streamed responses.
  • Binary message encoding.
  • 100MB buffer and message size limits.

Service methods invoked by the client will automatically specify an international locale based on the current thread's CurrentUICulture value.

Exceptions

ArgumentNullException

options is null.

InvalidOperationException

The options are invalid.

Methods

RetrieveFile(string)

Retrieves a file from Acuit Pinpoint.

public Stream RetrieveFile(string serverFileName)

Parameters

serverFileName string

The name of the file on the Acuit Pinpoint server.

Returns

Stream

A Stream from which the file contents can be read.

Remarks

With Acuit Pinpoint versions 7.1.87 and later, serverFileName can include environment variables quoted with the percent sign character (%).

Exceptions

FaultException<TDetail>

serverFileName is null.

FaultException<TDetail>

The serverFileName is an empty string, contains only white space, or contains one or more invalid characters.

FaultException<TDetail>

An I/O error occurred while opening the file.

FaultException<TDetail>

serverFileName specified a directory.

FaultException<TDetail>

The Acuit Pinpoint server process does not have the required permission to read the file.

FaultException<TDetail>

serverFileName is in an invalid format.

CommunicationException

A communication error occurred.

TimeoutException

A communication timeout error occurred.

RetrieveFileAsync(string)

Retrieves a file from Acuit Pinpoint.

public Task<Stream> RetrieveFileAsync(string serverFileName)

Parameters

serverFileName string

The name of the file on the Acuit Pinpoint server.

Returns

Task<Stream>

The task object representing the asynchronous operation.

Remarks

Once the operation completes, the Result property on the returned task object contains a Stream from which the file contents can be read.

With Acuit Pinpoint versions 7.1.87 and later, serverFileName can include environment variables quoted with the percent sign character (%).

Exceptions

FaultException<TDetail>

serverFileName is null.

FaultException<TDetail>

The serverFileName is an empty string, contains only white space, or contains one or more invalid characters.

FaultException<TDetail>

An I/O error occurred while opening the file.

FaultException<TDetail>

serverFileName specified a directory.

FaultException<TDetail>

The Acuit Pinpoint server process does not have the required permission to read the file.

FaultException<TDetail>

serverFileName is in an invalid format.

CommunicationException

A communication error occurred.

TimeoutException

A communication timeout error occurred.

Use(PinpointFileServiceClientOptions, Action<PinpointFileServiceClient>)

A helper to perform work with a PinpointFileServiceClient, properly closing the client and handling errors properly.

public static void Use(PinpointFileServiceClientOptions options, Action<PinpointFileServiceClient> worker)

Parameters

options PinpointFileServiceClientOptions

The client options to use for the Acuit Pinpoint service client.

worker Action<PinpointFileServiceClient>

The delegate that performs the work, which will be provided the Acuit Pinpoint service client as its only parameter.

Remarks

This uses Use<TClient>(Func<TClient>, Action<TClient>) internally. See the remarks for that method for more information.

Exceptions

ArgumentNullException

options is null.

ArgumentNullException

worker is null.

InvalidOperationException

The options are invalid.

CommunicationException

A communication error occurred. This includes faults.

TimeoutException

A communication timeout error occurred.

UseAsync(PinpointFileServiceClientOptions, Func<PinpointFileServiceClient, Task>)

A helper to perform work with a PinpointFileServiceClient, properly closing the client and handling errors properly.

public static Task UseAsync(PinpointFileServiceClientOptions options, Func<PinpointFileServiceClient, Task> worker)

Parameters

options PinpointFileServiceClientOptions

The client options to use for the Acuit Pinpoint service client.

worker Func<PinpointFileServiceClient, Task>

The delegate that performs the asynchronous work, which will be provided the Acuit Pinpoint service client as its only parameter and should return a task object representing the asynchronous operation.

Returns

Task

The task object representing the asynchronous operation.

Remarks

This uses UseAsync<TClient>(Func<TClient>, Func<TClient, Task>) internally. See the remarks for that method for more information.

Note: When targeting .NET 8 or later, using this method is unnecessary, as the client's IAsyncDisposable.DisposeAsync implementation provides the equivalent functionality in a more natural way using await using.

Exceptions

ArgumentNullException

options is null.

ArgumentNullException

worker is null.

InvalidOperationException

The options are invalid.

CommunicationException

A communication error occurred. This includes faults.

TimeoutException

A communication timeout error occurred.

UseAsync<TResult>(PinpointFileServiceClientOptions, Func<PinpointFileServiceClient, Task<TResult>>)

A helper to perform work with a PinpointFileServiceClient, properly closing the client and handling errors properly.

public static Task<TResult> UseAsync<TResult>(PinpointFileServiceClientOptions options, Func<PinpointFileServiceClient, Task<TResult>> worker)

Parameters

options PinpointFileServiceClientOptions

The client options to use for the Acuit Pinpoint service client.

worker Func<PinpointFileServiceClient, Task<TResult>>

The delegate that performs the asynchronous work, which will be provided the Acuit Pinpoint service client as its only parameter and should return a task object representing the asynchronous operation, producing as its result a value of type TResult.

Returns

Task<TResult>

The task object representing the asynchronous operation.

Type Parameters

TResult

The return value type.

Remarks

Once the operation completes, the Result property on the returned task object contains the value produced by worker.

This uses UseAsync<TClient, TResult>(Func<TClient>, Func<TClient, Task<TResult>>) internally. See the remarks for that method for more information.

Note: When targeting .NET 8 or later, using this method is unnecessary, as the client's IAsyncDisposable.DisposeAsync implementation provides the equivalent functionality in a more natural way using await using.

Exceptions

ArgumentNullException

options is null.

ArgumentNullException

worker is null.

InvalidOperationException

The options are invalid.

CommunicationException

A communication error occurred. This includes faults.

TimeoutException

A communication timeout error occurred.

Use<TResult>(PinpointFileServiceClientOptions, Func<PinpointFileServiceClient, TResult>)

A helper to perform work with a PinpointFileServiceClient, properly closing the client and handling errors properly.

public static TResult Use<TResult>(PinpointFileServiceClientOptions options, Func<PinpointFileServiceClient, TResult> worker)

Parameters

options PinpointFileServiceClientOptions

The client options to use for the Acuit Pinpoint service client.

worker Func<PinpointFileServiceClient, TResult>

The delegate that performs the work, which will be provided the Acuit Pinpoint service client as its only parameter and should return a value of type TResult.

Returns

TResult

The return value from worker.

Type Parameters

TResult

The return value type.

Remarks

This uses Use<TClient, TResult>(Func<TClient>, Func<TClient, TResult>) internally. See the remarks for that method for more information.

Exceptions

ArgumentNullException

options is null.

ArgumentNullException

worker is null.

InvalidOperationException

The options are invalid.

CommunicationException

A communication error occurred. This includes faults.

TimeoutException

A communication timeout error occurred.