-
Notifications
You must be signed in to change notification settings - Fork 612
BimServerClient
To connect to a BIMserver you can use one of the 3 protocols: SOAP, JSON or Protocol Buffers. To make connecting to a BIMserver even easier, there also is a Java library you can use.
From version 1.5 on we are using Maven for all dependency management. We suggest you do too when using the BIMserver Client library as it makes installing all the required dependencies a lot easier.
You can find the Maven XML snippet in the latest release notes, BIMserver 1.5.185. Make sure you match the version of the client with the version of your BIMserver. It looks something like this:
<dependency>
<groupId>org.opensourcebim</groupId>
<artifactId>bimserverclientlib</artifactId>
<version>1.5.185</version>
</dependency>
If you are using Eclipse for development, and you are not familiar with Maven yet, use this tutorial.
Of course you can also use the client from source code, in that case download a source zip file, or checkout the projects from GIT.
This example connects to a locally running BIMserver on port 8080, authenticates with the default username/password and then creates a new project.
package org.opensourcebim;
import org.bimserver.client.BimServerClient;
import org.bimserver.client.json.JsonBimServerClientFactory;
import org.bimserver.interfaces.objects.SProject;
import org.bimserver.shared.ChannelConnectionException;
import org.bimserver.shared.UsernamePasswordAuthenticationInfo;
import org.bimserver.shared.exceptions.BimServerClientException;
import org.bimserver.shared.exceptions.PublicInterfaceNotFoundException;
import org.bimserver.shared.exceptions.ServiceException;
public class ClientDemo {
public static void main(String[] args) {
try {
JsonBimServerClientFactory factory = new JsonBimServerClientFactory("http://localhost:8080");
BimServerClient client = factory.create(new UsernamePasswordAuthenticationInfo("[email protected]", "admin"));
SProject newProject = client.getServiceInterface().addProject("Test Project", "ifc2x3tc1");
System.out.println(newProject.getOid());
} catch (BimServerClientException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
} catch (ChannelConnectionException e) {
e.printStackTrace();
}
}
}
BIMserver 1.5 examples:
Examples on how to use the client-library can be found here.
Examples on how to use the client-side EMF model can be found here.
Examples on how to use the low-level-calls from the client library are here.
Get Started
- Quick Guide
- Requirements Version 1.2
- Requirements Version 1.3
- Requirements Version 1.4
- Requirements Version 1.4 > 2015-09-12
- Requirements Version 1.5
- Download
- JAR Starter
- Setup
Deployment
- Ubuntu installation 1.3
- Windows installation
- Security
- Memory Usage
- More memory
- Performance statistics
- Large databases
Developers
- Service Interfaces
- Common functions
- Data Model
- Low Level Calls
- Endpoints
Clients
BIMServer Developers
- Plugins in 1.5
- Plugin Development
- Eclipse
- Eclipse Modeling Framework
- Embedding
- Terminology
- Database/Versioning
- IFC STEP Encoding
- Communication
- Global changes in 1.5
- Writing a service
- Services/Notifications
- BIMserver 1.5 Developers
- Extended data
- Extended data schema
- Object IDM
New developments
- New remote service interface
- Plugins new
- Deprecated
- New query language
- Visual query language
- Reorganizing BIMserver JavaScript API
General