This project provides the WS client to the registry web services. It implements the GBIF Registry API.
Internally the module uses OpenFeign and Spring Cloud OpenFeign.
Common classes and configuration for clients can be found in the project gbif-common-ws.
The registry-ws client can be configured in the following ways:
Example:
// set this to the web service URL. It might be localhost:8080 for local development
String wsUrl = "http://api.gbif.org/v1/";
ClientBuilder clientBuilder = new ClientBuilder();
clientBuilder.withUrl(wsUrl);
DatasetServcie datasetClient = clientBuilder.build(DatasetClient.class);
This includes authentication functionality. There are two ways: use simple user basic authentication or GBIF app authentication.
// set this to the web service URL. It might be localhost:8080 for local development
String wsUrl = "http://api.gbif.org/v1/";
String password = "password";
String username = "username";
ClientBuilder clientBuilder = new ClientBuilder();
clientBuilder
.withUrl(wsUrl)
.withCredentials(username, password);
DatasetServcie datasetClient = clientBuilder.build(DatasetClient.class);
Make sure you are using right properties wsUrl
, username
and passowrd
.
// set this to the web service URL. It might be localhost:8080 for local development
String wsUrl = "http://api.gbif.org/v1/";
String appKey = "app.key";
String secretKey = "secret-key";
String username = "username";
ClientBuilder clientBuilder = new ClientBuilder();
clientBuilder
.withUrl(wsUrl)
.withAppKeyCredentials(username, appKey, secretKey);
DatasetServcie datasetClient = clientBuilder.build(DatasetClient.class);
Make sure you are using right properties wsUrl
, username
, appKey
and secretKey
.