The net.servicestack:client package provides a typed JsonServiceClient for calling ServiceStack APIs from any
Java 8+ JVM Application, whilst net.servicestack:android adds Android-specific Async APIs and Server Events
support:
dependencies {
implementation 'net.servicestack:client:1.1.5'
}
Generate the Typed DTOs for any ServiceStack API with npx get-dtos:
npx get-dtos java https://test.servicestack.net
Then call APIs by sending populated Request DTOs:
JsonServiceClient client = new JsonServiceClient("https://test.servicestack.net");
HelloResponse response = client.get(new Hello().setName("World"));
System.out.println(response.getResult()); //= Hello, World!
Docs​
- Java Add ServiceStack Reference
- Java Server Events Client
- Kotlin Add ServiceStack Reference
- Release Notes for Java Support
Source and Packages​
- ServiceStack.Java - Java Client, Server Events Client and IDE plugins
- net.servicestack:client - pure Java client package
- net.servicestack:android - Android client package
- Java Client Test Suite - Live examples of all client features
- Java LINQ Examples - C#'s 101 LINQ Samples in Java