...
The ServiceMix Validation component provides schema validation of documents using JAXP 1.3 and XMLSchema or RelaxNG.
Note | ||
---|---|---|
| ||
Note that this component is only available in releases >= 3.3. |
Installation
Installing the servicemix-validation component can be done in several ways:
- drop the installer zip in an hotdeploy directory monitored by ServiceMix
- using ant tasks
Note that when using ant tasks, the component is not started, you will have to start it manually using ant tasks or a console.
...
Maven Archetype
You can use Maven servicemix-validation-service-unit archetype to create a Validation service unit.:
Code Block |
---|
mvn archetype:create \ -DarchetypeGroupId=org.apache.servicemix.tooling \ -DarchetypeArtifactId=servicemix-validation-service-unit \ -DarchetypeVersion=2010.01 \ -DgroupId=comyour.mycompanygroup.myproductid \ -DartifactId=mycomponentyour.artifact |
or simply use the smx-arch tool from ServiceMix's bin folder.
...
.id \
-Dversion=your-version
|
Once you've customized the service unit, simply install the SU:
Code Block |
---|
mvn install
|
Info | ||
---|---|---|
Remember that to be deployable in ServiceMix, the ServiceUnit has to be embedded in a Service Assembly: only the Service Assembly zip file can be deployed in ServiceMix.
|
Endpoint Configuration
A Validation endpoint expects messages coming from the NMR and validate message payload using given schema.
Note | ||
---|---|---|
| ||
The endpoint can handle all MEPs. |
Code Block | ||||
---|---|---|---|---|
| ||||
<validation:endpoint service="test:myAddressValidationService" endpoint="addressValidationEndpoint" schemaResource="classpath:address.xsd" handlingErrorMethod="FAULT_FLOW" /> | ||||
| ||||
The endpoint can handle all MEPs. |
The following table shows the additional configuration possibilities of the endpoint.
Info | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||
|
...
The schemaResource
The schema resource can be defined in different ways:
...