Class PinpointFileServiceClient
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
optionsPinpointFileServiceClientOptionsThe 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
optionsis null.- InvalidOperationException
The options are invalid.
Methods
RetrieveFile(string)
Retrieves a file from Acuit Pinpoint.
public Stream RetrieveFile(string serverFileName)
Parameters
serverFileNamestringThe name of the file on the Acuit Pinpoint server.
Returns
Remarks
With Acuit Pinpoint versions 7.1.87 and later, serverFileName can include environment variables quoted with the percent sign
character (%).
Exceptions
- FaultException<TDetail>
serverFileNameis null.- FaultException<TDetail>
The
serverFileNameis 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>
serverFileNamespecified a directory.- FaultException<TDetail>
The Acuit Pinpoint server process does not have the required permission to read the file.
- FaultException<TDetail>
serverFileNameis 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
serverFileNamestringThe name of the file on the Acuit Pinpoint server.
Returns
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>
serverFileNameis null.- FaultException<TDetail>
The
serverFileNameis 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>
serverFileNamespecified a directory.- FaultException<TDetail>
The Acuit Pinpoint server process does not have the required permission to read the file.
- FaultException<TDetail>
serverFileNameis 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
optionsPinpointFileServiceClientOptionsThe client options to use for the Acuit Pinpoint service client.
workerAction<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
optionsis null.- ArgumentNullException
workeris 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
optionsPinpointFileServiceClientOptionsThe client options to use for the Acuit Pinpoint service client.
workerFunc<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
optionsis null.- ArgumentNullException
workeris 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
optionsPinpointFileServiceClientOptionsThe client options to use for the Acuit Pinpoint service client.
workerFunc<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
TResultThe 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
optionsis null.- ArgumentNullException
workeris 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
optionsPinpointFileServiceClientOptionsThe client options to use for the Acuit Pinpoint service client.
workerFunc<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
TResultThe 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
optionsis null.- ArgumentNullException
workeris null.- InvalidOperationException
The options are invalid.
- CommunicationException
A communication error occurred. This includes faults.
- TimeoutException
A communication timeout error occurred.