Package net.ionite.docval.server
Class DocValHttpClient
java.lang.Object
net.ionite.docval.server.DocValHttpClient
A client to the ion-docval server
- Author:
- Ionite
-
Constructor Summary
ConstructorDescriptionConstruct a client with a default server URI: http://localhost:35791/api/validateDocValHttpClient
(String uri) Construct a client with the given server URI -
Method Summary
Modifier and TypeMethodDescriptionvalidate
(byte[] documentData) Send the given XML document to the server for validation, using a keyword derived from the document (seeKeywordDeriver
for more information on keyword derivation).Send the given XML document to the server for validation, using the given keyword.
-
Constructor Details
-
DocValHttpClient
public DocValHttpClient()Construct a client with a default server URI: http://localhost:35791/api/validate -
DocValHttpClient
Construct a client with the given server URI- Parameters:
uri
- The URI where the ion-docval-server is hosted
-
-
Method Details
-
validate
Send the given XML document to the server for validation, using a keyword derived from the document (seeKeywordDeriver
for more information on keyword derivation). Parses the server's response into a ValidationResult object.- Parameters:
documentData
- Byte-array containing the XML document to validate- Returns:
- ValidationResult The validation result from the server
- Throws:
DocValClientException
- If the server could not be reached, or it did not return a validation result.
-
validate
Send the given XML document to the server for validation, using the given keyword. Parses the server's response into a ValidationResult object.- Parameters:
documentData
- Byte-array containing the XML document to validatekeyword
- The keyword the server uses to select which validation to use- Returns:
- ValidationResult The validation result from the server
- Throws:
DocValClientException
- If the server could not be reached, or it did not return a validation result.
-