Skip to content

primelib/webmethodsapigateway4j

Repository files navigation

WebMethodsAPIGateway4J

Maven Central javadoc

A java client for the WebMethods API Gateway REST API.

Installation

implementation("io.github.primelib:webmethodsapigateway4j:<latestVersion>")

Click to view instructions for other build tools.

Usage

Consumer Specification Approach

APIGatewayConsumerApi client = APIGatewayFactory.create(spec -> {
    spec.api(APIGatewayConsumerApi.class);
    spec.baseUrl("http://localhost:5555/rest/apigateway");
    spec.basicAuth(auth -> {
        auth.username("admin");
        auth.password("manage");
    });
});

APIResponsesModel apis = client.getAPIs(spec -> {
    spec.from(0);
    spec.size(100);
});

Parameter Approach

APIGatewayApi client = APIGatewayFactory.create(spec -> {
    spec.api(APIGatewayApi.class);
    spec.baseUrl("http://localhost:5555/rest/apigateway");
    spec.basicAuth(auth -> {
        auth.username("admin");
        auth.password("manage");
    });
});

APIResponsesModel apis = client.getAPIs(null, 0, 100);

NOTE: The Parameter Approach can break if the API changes. The Consumer Specification Approach is more resilient to API changes.

Links

License

Released under the MIT License.