You can use schema validation, but you’ll probably need to define the 10 fields to not have any length limits–otherwise the validation will fail and you’ll have to have code that determines which failures are real and which can be ignored.
Here is what I’d do:
- Define the xsd that has all the field definitions the way they should be with length limits and such.
- Provide that xsd (or wsdl) to partners and tell them to conform.
- From the xsd, create the corresponding IS schema and doc type.
- When an incoming document fails validation, reply to the partner with an error and reject the document. Don’t truncate fields and don’t try to fix the invalid document–it’s the partner’s job to conform to the xsd.
If you want to allow documents from partners to have some fields that are too long for one or more of the target systems that will receive that data:
- Define the xsd that has all the field definitions the way they should be with length limits and such. For the fields where you will truncate, don’t specify a max length.
- Provide that xsd (or wsdl) to partners and tell them to conform.
- From the xsd, create the corresponding IS schema and doc type.
- When an incoming document fails validation, reply to the partner with an error and reject the document. The fields that are defined as unlimited length will pass the validation.
- During mapping to the target document(s), truncate the fields that need to be truncated. Log the orders that have fields that are too long if you want to, but the value of doing so is probably limited–you can’t tell your partner that they’re doing things wrong if they are conforming to your xsd.
In other words, use validation the way it was intended. Don’t try to implement “validate this but not that”–it introduces unnecessary complexity.
As for “…performance might be much faster” you’re probably optimizing too soon. Chances are, a FLOW service will be more than sufficient. There are many threads on the forums about this. If performance was truly the only issue to consider, you’d be writing all this in C/C++ and not in Java and certainly not in an integration server where you don’t have much control over how your Java methods are managed and executed.
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB