QueryBuilder and UpdateBuilder
Another option to call the Internet Computer canisters from Java is to use QueryBuilder and UpdateBuilder.
Use these options if direct manipulation with Candid data is required or there is a requirement for dynamic invocation.
Create byte[] array binary Candid payload as an input argument using IDLArgs.
QueryBuilder
QueryBuilder Method create has 3 arguments, agent, canister id principal and method name.
Optionally, the expiration time can be set using Methods expireAfter or expireAt.
Pass binary payload as a parameter of arg method and execute using Method call.
UpdateBuilder
UpdateBuilder uses very similar syntax to Method create, but has one extra method, callAndWait ,if explicit Waiter definition is required.
Use this to convert response payload to Java objects from binary Candid response payload.
Last updated