This library provides an implementation of the client side of the e-Contracts Web Service.
This library can be used to:
A contract is considered final if all recipients have signed the contract.
The client library is available within the e-contract.be Maven repository. Configure this Maven repository within your pom.xml as follows:
<repositories> <repository> <id>e-contract.be</id> <url>https://www.e-contract.be/maven2/</url> </repository> </repositories>
Add the client library within your pom.xml dependencies element as follows:
<dependency> <groupId>be.e_contract.e_contracts.e-contracts-service</groupId> <artifactId>e-contracts-service-client</artifactId> <version>0.2.0</version> </dependency>
The application identifier and application secret can be retrieved by self registration of your application. Register your application via the e-Contracts portal.
EContractsServiceClient client = new EContractsServiceClient("https://www.e-contract.be/contracts/ws"); client.setCredentials("the-application-identifier", "the-application-secret-hex-encoded");
String title = "contract title"; byte[] pdfDocument = ...; Set<String> recipients = new HashSet<String>(); recipients.add("info@e-contract.be"); recipients.add("sales@e-contract.be"); long contractIdentifier = client.createContract(title, "document-filename.pdf", pdfDocument, recipients);
List<Long> contractIdentifiers = client.getContractIdentifiers(false);
To query all contract that are in their final stage (i.e., all recipients have signed):
List<Long> finalContractIdentifiers = client.getContractIdentifiers(true);
ContractDetailsResponseType contractDetails = client.getContractDetails(contractIdentifier);
To poke all recipients that did not yet sign the contract:
client.pokeRecipients(contractIdentifier);