# OpcClient.CallMethods Method

> Reference: Calls the methods as defined by the commands specified using a single call methods service request.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClient</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcClient Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

<span class="api-meta">2 overloads · since v2.8</span>

| Overload | Description |
|---|---|
| [CallMethods(IEnumerable&lt;OpcCallMethod&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/callmethods#callmethods-system-collections-generic-ienumerable-of-opc-uafx-opccallmethod)<span class="api-meta">since v2.8</span> | Calls the methods as defined by the `commands` specified using a single call methods service request. |
| [CallMethods(params OpcCallMethod\[\])](#callmethods-opc-uafx-opccallmethod-array)<span class="api-meta">since v2.8</span> | Calls the methods as defined by the `commands` specified using a single call methods service request. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The client is not connected to the server, the service execution failed or the server reported a bad status code for one of the calls or for one of their input arguments. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

## CallMethods(IEnumerable&lt;OpcCallMethod&gt;)

<span class="api-meta">since v2.8</span>

Calls the methods as defined by the `commands` specified using a single call methods service request.

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

```csharp
public object[][] CallMethods(IEnumerable<OpcCallMethod> commands)
```

</div>

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

```vbnet
Public Function CallMethods(
    commands As IEnumerable(Of OpcCallMethod)) As Object()()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcCallMethod](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccallmethod/)&gt; | A sequence of [OpcCallMethod](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccallmethod/) commands, each defining the object, the method and the values of the input arguments of a call. |

**Returns**

[Object](https://learn.microsoft.com/dotnet/api/system.object)[][]

An array which contains for each command, in the order of the `commands`, an array of the values of the output arguments returned by the method.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence is a null reference (Nothing in Visual Basic). |
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |

## CallMethods(params OpcCallMethod\[\])

<span class="api-meta">since v2.8</span>

Calls the methods as defined by the `commands` specified using a single call methods service request.

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

```csharp
public object[][] CallMethods(params OpcCallMethod[] commands)
```

</div>

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

```vbnet
Public Function CallMethods(
    ParamArray commands As OpcCallMethod()) As Object()()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | params [OpcCallMethod](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccallmethod/)[] | An array of [OpcCallMethod](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccallmethod/) commands, each defining the object, the method and the values of the input arguments of a call. |

**Returns**

[Object](https://learn.microsoft.com/dotnet/api/system.object)[][]

An array which contains for each command, in the order of the `commands`, an array of the values of the output arguments returned by the method.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` array is a null reference (Nothing in Visual Basic). |
