# IOpcService&lt;TResponse, TRequest&gt; Members

> Reference: Defines a generic interface which is to be used by an OPC UA client application to provide the necessary service-orientated architecture (SOA) to take use of an OPC UA service defined by an OPC UA server.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcService&lt;TResponse, TRequest&gt;</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.services">Opc.UaFx.Services</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Methods

### Invoke

Executes the service using the specified `request` data.

<div class="api-signature" data-lang="csharp">

```csharp
TResponse Invoke(TRequest request)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function Invoke(request As TRequest) As TResponse
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `request` | TRequest | The `TRequest` data to use to execute the service. |

**Returns**

TResponse

The `TResponse` of the service after processing the `request`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `request` data is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The requested operation is currently not supported, especially using the `request` information specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details see exception details. |
