---
title: "Testing the Nodinite LDAP Web API: Swagger, Connectivity Validation, and Active Directory"
description: "Test the Nodinite LDAP Web API in Swagger: reach the domain controller with GetDomainControllers, then test the connection's credentials and authentication type with a user search, in XML or JSON (4.0.1 and later)."
---

# <i class="fal fa-vial" aria-hidden="true"></i> Testing the Nodinite LDAP Web API

Validate your <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [LDAP Web API][] installation quickly and confidently using the built-in Swagger UI.

* ✅ Verify LDAP Web API connectivity with built-in Swagger UI  
* ✅ Test Active Directory operations using JSON and XML payloads  
* ✅ Confirm your connectionId and settings are correct  
* ✅ Reach the domain controller with GetDomainControllers, then test credentials with a search  

>This guide assumes you have completed the [Install][] and [Configuration][] steps.

## <i class="fal fa-list-check" aria-hidden="true"></i> Before You Begin

Ensure you have completed these prerequisite steps before testing:

* [Prerequisites][] — For IIS hosting, the [.NET 10 Hosting Bundle](https://aka.ms/dotnet/10.0/dotnet-hosting-win.exe)<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> is installed (version 3.1.0 and later)
* [Install][] — The <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP Web API is running in [IIS][] or Azure App Service
* [Configuration][] — You have configured at least one connection in `settings.json` with a valid connectionId

## <i class="fal fa-globe" aria-hidden="true"></i> Step 1: Open Swagger UI

Navigate to the built-in Swagger UI to explore and test all available API endpoints.

For IIS, use:

```text
http://localhost/LDAPAdapter/swagger/
```

Replace `LDAPAdapter` with the virtual directory name you configured during installation. For HTTPS (recommended), use:

```text
https://YOURSERVER/swagger/
```

![Swagger UI listing the LDAP Web API operations][1]  
*Screenshot: The built-in Swagger UI for the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP Web API.*  

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>If the page returns <strong>HTTP Error 500.19</strong> or <strong>500.30</strong> instead of Swagger, the .NET 10 Hosting Bundle is missing or was installed before the IIS features. See <a href="https://docs.nodinite.com/ldap-web-api/troubleshooting/overview/#http-error-500.19-or-500.30-after-installing-or-updating">Troubleshooting</a>.</p></div>
</aside>

## <i class="fal fa-id-card" aria-hidden="true"></i> Step 2: Set the connectionId

Before executing any LDAP operations, set the `connectionId` to the GUID you configured in `settings.json`.

The `connectionId` identifies which LDAP server and credentials to use for the operation.

## <i class="fal fa-server" aria-hidden="true"></i> Step 3: Test Active Directory Connectivity

Use the `GetDomainControllers` operation to verify that the API can reach Active Directory. This operation typically does not require administrative rights.

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Use a port <strong>389</strong> connection for <code>GetDomainControllers</code> and the Schema operations. They fail on a port 636 connection.</p></div>
</aside>

Set the content type header to match your payload format:

* **JSON** — Set content type to `application/json`
* **XML** — Set content type to `text/xml` or `application/xml`

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>JSON responses only work from LDAP Web API <strong>4.0.1</strong>. In 3.x, every JSON request returns an empty HTTP 500. Use XML with 3.x.</p></div>
</aside>

### XML Payload

```xml
<ns0:LDAP xmlns:ns0="http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0">
  <Batches guid="2B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8D" returnResponseMessageOnExceptions="true">
    <Batch guid="3B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8E">
      <AD>
        <Operations>
          <GetDomainControllers/>
        </Operations>
      </AD>
    </Batch>
  </Batches>
</ns0:LDAP>
```

<h3 id="json-payload-401-and-later">JSON Payload (4.0.1 and later)</h3>

In JSON, `Operations` needs one extra `Operations` level, because the API converts the object to XML and XML needs one root element. Without it, the request returns HTTP 200 with an **empty** result.

```json
{
  "RequestId": "b7a211d7-20f3-44bc-b078-7f1b6e1c047f",
  "ReturnResponseOnExceptions": true,
  "Batches": [
    {
      "continueOnError": false,
      "guid": "2b25b9e6-4af2-4094-9ae7-e1e4c99b6c8d",
      "AD": {
        "Operations": {
          "Operations": {
            "GetDomainControllers": {}
          }
        }
      }
    }
  ]
}
```

In JSON:

* Operation attributes use `@`, for example `{ "GetAllOptionalAttributes": { "@className": "user" } }`.
* An operation without attributes can be an empty object `{}` or an empty string `""`.
* `ReturnResponseOnExceptions` sits at the top level, next to `RequestId`. It is the JSON name for the XML attribute `returnResponseMessageOnExceptions`: errors come back in the response instead of as an exception.

![GetDomainControllers response listing domain controllers in Swagger][2]  
*Screenshot: Example result from the GetDomainControllers test in Swagger.*  

## <i class="fal fa-circle-check" aria-hidden="true"></i> Step 4: Verify the Response

A successful response confirms that the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP Web API can reach the domain controller. It does not test the credentials: `GetDomainControllers` and the Schema operations ignore `AuthenticationType`, `UserName`, and `Password`. Run [Step 5](#fa-magnifying-glass-step-5-test-a-search) to test a search.

If the response is empty or returns an error, review your [Configuration][] settings:

* `DSAServer` — DNS name or IP address of your domain controller
* `DSAServerPort` — Use a port 389 connection for this test
* JSON on 3.x — Use XML instead (see the note above)

If the configuration is correct but the call times out, test the ports with the [TCP and UDP ports][] user guide.

## <i class="fal fa-magnifying-glass" aria-hidden="true"></i> Step 5: Test a Search

A search uses the connection's credentials and authentication type, so it is the real test of a connection. This request selects up to 5 users from the built-in Users container. Replace the `DC` value with your domain.

### XML Search Payload

```xml
<ns0:LDAP xmlns:ns0="http://integrationsoftware.se/BizTalk/Adapters/LDAP/Request/1.0">
  <Batches guid="2B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8D" returnResponseMessageOnExceptions="true">
    <Batch guid="3B25B9E6-4AF2-4094-9AE7-E1E4C99B6C8E">
      <User>
        <With OU="CN=Users" DC="DC=wildwest,DC=local" searchScope="Subtree" sizeLimit="5" returnProperties="name"/>
        <Operations>
          <Select/>
        </Operations>
      </User>
    </Batch>
  </Batches>
</ns0:LDAP>
```

### JSON Search Payload (4.0.1 and later)

```json
{
  "RequestId": "b7a211d7-20f3-44bc-b078-7f1b6e1c047f",
  "ReturnResponseOnExceptions": true,
  "Batches": [
    {
      "continueOnError": false,
      "guid": "2b25b9e6-4af2-4094-9ae7-e1e4c99b6c8d",
      "User": {
        "With": {
          "OU": "CN=Users",
          "DC": "DC=wildwest,DC=local",
          "searchScope": "Subtree",
          "sizeLimit": 5,
          "returnProperties": "name"
        },
        "Operations": {
          "Operations": {
            "Select": {}
          }
        }
      }
    }
  ]
}
```

**Expected result:** `ReturnStatus` **Success** and up to 5 users.

### If the Search Fails

Read the **second** line of `ExceptionMessageExtended`. The first line is always the generic *"Find objects in directory failed…"*; the real cause follows:

|Message in `ExceptionMessageExtended`|Cause|  
|---|---|  
|`The server is not operational`|`AuthenticationType` doesn't fit the port, see [AuthenticationType per port][Auth per port]|  
|`The user name or password is incorrect`|Wrong or empty `UserName` / `Password`, see [Configuration][]|  

### Search Tips

* The built-in Users folder is a container, so it is `OU="CN=Users"`, not `OU="OU=Users"`.
* `CN` needs its prefix: `CN="CN=Administrator"`.
* JSON with LDAP.Libraries older than 3.1.1: add `"searchFilter": ""` to `With` for Group and OU operations.

### Test Everything in One Request (JSON, 4.0.1 and later)

One request can hold several batches. This one runs the three tests in a row on the same connection: `GetDomainControllers`, a User search, and a Group search, each in its own batch with its own `guid`. Use a port 389 connection, because `GetDomainControllers` fails on port 636, and replace the `DC` value with your domain.

```json
{
  "RequestId": "70000000-0000-0000-0000-000000000007",
  "ReturnResponseOnExceptions": true,
  "Batches": [
    { "guid": "70000000-0000-0000-0000-000000000071", "AD": { "Operations": { "Operations": { "GetDomainControllers": "" } } } },
    {
      "guid": "70000000-0000-0000-0000-000000000072",
      "User": {
        "With": { "OU": "CN=Users", "DC": "DC=dev,DC=local", "searchScope": "Subtree", "sizeLimit": 3, "returnProperties": "name" },
        "Operations": { "Operations": { "Select": "" } }
      }
    },
    {
      "guid": "70000000-0000-0000-0000-000000000073",
      "Group": {
        "With": { "OU": "CN=Users", "DC": "DC=dev,DC=local", "searchScope": "Subtree", "sizeLimit": 3, "returnProperties": "name" },
        "Operations": { "Operations": { "Select": "" } }
      }
    }
  ]
}
```

**Expected result:** three batches with `ReturnStatus` **Success**: the domain controllers, up to 3 users, and up to 3 groups from the built-in Users container. If the first batch succeeds and the others fail, the API reaches the domain controller but the credentials or `AuthenticationType` are wrong, see [If the Search Fails](#if-the-search-fails).

## <i class="fal fa-question" aria-hidden="true"></i> Frequently Asked Questions

You will find additional solutions to common problems and the FAQ for the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [LDAP Web API][] in the [Troubleshooting][] user guide.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

<i class="fal fa-code" aria-hidden="true"></i> [Develop][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* [Prerequisites][]  
* [Install][]  
* [Configuration][]  
* [AD Management][]  
* [User Management][]  
* [LDAP Web API][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/Install/Swagger.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/LDAP%20WebAPI/AD/GetDomainControllersSwagger.png

[AD Management]:https://docs.nodinite.com/ldap-web-api/features/ad-management/
[Auth per port]:https://docs.nodinite.com/ldap-web-api/getting-started/configuration/#authenticationtype-per-port
[Configuration]:https://docs.nodinite.com/ldap-web-api/getting-started/configuration/
[Develop]:https://docs.nodinite.com/ldap-web-api/getting-started/developing/
[HTTP 500.19]:https://docs.nodinite.com/ldap-web-api/troubleshooting/overview/#http-error-500.19-or-500.30-after-installing-or-updating
[IIS]:https://docs.nodinite.com/logging-and-monitoring/windows-server/features/iis/
[Install]:https://docs.nodinite.com/ldap-web-api/getting-started/install/
[LDAP Web API]:https://docs.nodinite.com/ldap-web-api/overview/
[Prerequisites]:https://docs.nodinite.com/ldap-web-api/getting-started/prerequisites/
[TCP and UDP ports]:https://docs.nodinite.com/ldap-web-api/troubleshooting/tcp-and-udp-ports/
[Troubleshooting]:https://docs.nodinite.com/ldap-web-api/troubleshooting/overview/
[User Management]:https://docs.nodinite.com/ldap-web-api/features/user-management/