Xbim.WexServer.Client
1.0.0
dotnet add package Xbim.WexServer.Client --version 1.0.0
NuGet\Install-Package Xbim.WexServer.Client -Version 1.0.0
<PackageReference Include="Xbim.WexServer.Client" Version="1.0.0" />
<PackageVersion Include="Xbim.WexServer.Client" Version="1.0.0" />
<PackageReference Include="Xbim.WexServer.Client" />
paket add Xbim.WexServer.Client --version 1.0.0
#r "nuget: Xbim.WexServer.Client, 1.0.0"
#:package Xbim.WexServer.Client@1.0.0
#addin nuget:?package=Xbim.WexServer.Client&version=1.0.0
#tool nuget:?package=Xbim.WexServer.Client&version=1.0.0
Xbim.WexServer.Client
A typed HTTP client for the Xbim Server API. Use this package to connect your BIM applications to Xbim Server for model storage, processing, and management. Auto-generated from OpenAPI/Swagger specifications using NSwag.
This package is required when using Xbim.WexBlazor in Platform mode (connected to Xbim Server). For standalone viewer applications without a backend, you only need Xbim.WexBlazor.
Features
- Typed API Client - Full IntelliSense support for all endpoints
- Authentication Support - Pluggable token provider for JWT authentication
- Resilience - Built-in retry policies and circuit breakers via Microsoft.Extensions.Http.Resilience
- HttpClientFactory - Proper HTTP client lifecycle management
Installation
# Add GitHub Packages source (one-time setup)
dotnet nuget add source https://nuget.pkg.github.com/Ibrahim5aad/index.json --name github --username YOUR_GITHUB_USERNAME --password YOUR_GITHUB_PAT
# Install the package
dotnet add package Xbim.WexServer.Client
Note: The
YOUR_GITHUB_PATneedsread:packagesscope. Create a PAT here.
Quick Start
Basic Setup
// Program.cs
builder.Services.AddWexServerClient(options =>
{
options.BaseUrl = "https://your-Xbim-server.com";
});
With Authentication
Implement IAuthTokenProvider for your authentication flow:
public class MyTokenProvider : IAuthTokenProvider
{
public Task<string?> GetTokenAsync(CancellationToken cancellationToken = default)
{
// Return your JWT token
return Task.FromResult<string?>("your-jwt-token");
}
}
Register with DI:
builder.Services.AddSingleton<IAuthTokenProvider, MyTokenProvider>();
builder.Services.AddWexServerClient(options =>
{
options.BaseUrl = "https://your-Xbim-server.com";
});
Using the Client
@inject IXbimClient Client
// List workspaces
var workspaces = await Client.WorkspacesAllAsync();
// Create a project
var project = await Client.ProjectsPOSTAsync(new CreateProjectRequest
{
Name = "My Project",
WorkspaceId = workspaceId
});
// Upload a model
using var stream = File.OpenRead("model.ifc");
var file = await Client.UploadAsync(new FileParameter(stream, "model.ifc"));
// Get element properties
var properties = await Client.PropertiesAsync(modelVersionId, elementId);
API Endpoints
The client provides typed methods for all server endpoints:
| Method | Description |
|---|---|
WorkspacesAllAsync() |
List all workspaces |
WorkspacesPOSTAsync(request) |
Create workspace |
WorkspacesGETAsync(id) |
Get workspace by ID |
ProjectsAllAsync() |
List all projects |
ProjectsPOSTAsync(request) |
Create project |
ModelsAllAsync() |
List all models |
ModelsPOSTAsync(request) |
Create model |
VersionsAllAsync(modelId) |
List model versions |
VersionsPOSTAsync(modelId, request) |
Create version |
UploadAsync(file) |
Upload file |
PropertiesAsync(versionId, elementId) |
Get element properties |
UsageAsync(workspaceId) |
Get storage usage |
Configuration Options
builder.Services.AddWexServerClient(options =>
{
// Required: Server base URL
options.BaseUrl = "https://api.example.com";
// Optional: Request timeout (default: 30s)
options.Timeout = TimeSpan.FromMinutes(2);
});
Manual Client Creation
For scenarios without DI:
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://your-server.com")
};
var client = new XbimClient(httpClient);
var workspaces = await client.WorkspacesAllAsync();
Regenerating the Client
If the server API changes, regenerate the client:
# Fetch latest swagger.json from running server
dotnet msbuild -t:FetchSwagger -p:ServerUrl=http://localhost:5000
# Regenerate client code
dotnet msbuild -t:RegenerateClient
# Or combined
dotnet msbuild -t:UpdateClient -p:ServerUrl=http://localhost:5000
Requirements
- .NET 9.0+
- Xbim Server instance
Dependencies
Newtonsoft.Json- JSON serializationMicrosoft.Extensions.Http- HttpClientFactoryMicrosoft.Extensions.Http.Resilience- Retry policies
License
MIT
Related Packages
- Xbim.WexBlazor - Blazor component library for 3D BIM visualization
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Http.Resilience (>= 9.0.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Xbim.WexServer.Client:
| Package | Downloads |
|---|---|
|
Xbim.WexBlazor
A Blazor wrapper for the xBIM Viewer, providing seamless integration of 3D BIM model visualization in Blazor WebAssembly applications. Includes model management, toolbar system, and plugin support. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 127 | 2/18/2026 |