-
1. Re: Validation
ryanhos Dec 2, 2008 11:48 AM (in response to r1c)Ric,
I don't believe that there is a canned xml validation action in the standard distribution. I suspect that many individuals are taking advantage of the implicit validation performed via the various xml-to-pojo mapping frameworks.
If you end up writing a validation action, I'm sure the project would gratefully accept it as a donation if your circumstances permit you to do so. I've written several EIP-inspired routers and actions, but my employer has yet to give me the go-ahead to donate them. JBoss ESB has promise, but needs quite a few additional standard features to be really useful out of the box. -
2. Re: Validation
beve Dec 2, 2008 4:35 PM (in response to r1c)Hi Ric,
I've added a Jira for this: https://jira.jboss.org/jira/browse/JBESB-2213. This has been committed to the main svn trunk:
Action: http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/validation/SchemaValidationAction.java
Test: http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/validation/SchemaValidationActionUnitTest.java
There is a quickstart named schema_validation that demos the action:
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/samples/quickstarts/schema_validation/
If you are not in a position to build from the trunk you could simple copy the action and use in your project until the next release comes out.
Let us know if you have any additional requirement for such this action.
Regards,
/Daniel -
3. Re: Validation
r1c Dec 3, 2008 3:31 AM (in response to r1c)Hi,
Thank you both for your responses and Daniel that's pretty impressive efficiency.
Currently I am evaluating JBossESB for a customer and have some other work to do so I'll have a look at the action later. For now I think the requirement is simply to validate a message against a schema so what you have commited should tick that box.
I do have other questions but I'll start a fresh thread as soon as I get a chance.
Thanks again.
Ric -
4. Re: Validation
kconner Dec 3, 2008 4:21 AM (in response to r1c)It is not necessary to add such an action to the ESB as there is already support for validation. Why does the current code not work for you??
-
5. Re: Validation
r1c Dec 3, 2008 4:28 AM (in response to r1c)Hi Kevin,
It's not that the current code does not work for me, I am currently evaluating the ESB and was looking for something that does validation.
I couldn't see anything obvious in the docs for specifying a schema to validate messages so posted asking for advice.
Can you provide an example of how the current release supports this?
Thanks,
Ric -
6. Re: Validation
kconner Dec 3, 2008 5:23 AM (in response to r1c)The current codebase includes the capability of exposing a service through a webservice and, as part of this, introduced the ability to validate the schema. This has been enhanced slightly by the work for https://jira.jboss.org/jira/browse/JBESB-1984
The base code is already in the trunk and will be released as part of ESB 4.5, the work having been done for the SOA platform 4.3 release.
The additional modifications have not been ported across to trunk as of yet as we need to develop a mechanism for handling the evolution of the schema. Once this is complete we will move the rest across to trunk and will also release them as part of ESB 4.5.
The original work was handled by Jim Ma and moved across to the platform branch by myself as part of https://jira.jboss.org/jira/browse/JBESB-1653
(next posting for details) -
7. Re: Validation
tfennelly Dec 3, 2008 5:39 AM (in response to r1c)So if the message was (for example) delivered via the file router, can this be used to validate the message? Support for multiple schemas?
-
8. Re: Validation
kconner Dec 3, 2008 5:40 AM (in response to r1c)Now for the specifics.
There is a quickstart within trunk that demonstrates the use of the webservice feature, as can be seen from the following configuration.
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
This configuration specifies the schema for the request, response and for user defined faults.
The validation is enabled by setting the 'validate' attribute on the 'actions' element to true. This will force the pipeline to validate the incoming request and outgoing response against the specified schemas.
The platform branch also contains a unit test for testing the validation and the enhancements covered by JBESB-1984.
The configuration for the test is http://anonsvn.jboss.org/repos/labs/labs/jbossesb/branches/JBESB_4_4_GA_CP/qa/junit/resources/server/ebws/META-INF/jboss-esb.xml and this will be included in the ESB 4.5 work. -
9. Re: Validation
r1c Dec 3, 2008 5:41 AM (in response to r1c)As I understand what you are saying is that there will be schema validation for services exposed as webservices in the next release of the ESB.
I am looking for the ability to receive a plain XML payload over HTTP - no SOAP - and validate the XML against a configured schema. I guess this scenario is not covered by ESB using the features you describe. -
10. Re: Validation
kconner Dec 3, 2008 5:44 AM (in response to r1c)The current trunk would therefore support something like the following
<actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" validate="true"> <action ... /> <action ... /> </actions>
-
11. Re: Validation
kconner Dec 3, 2008 5:47 AM (in response to r1c)"r1c" wrote:
As I understand what you are saying is that there will be schema validation for services exposed as webservices in the next release of the ESB.
The service does not need to be exposed over webservices for validation to be used."r1c" wrote:
I am looking for the ability to receive a plain XML payload over HTTP - no SOAP - and validate the XML against a configured schema. I guess this scenario is not covered by ESB using the features you describe.
Yes, this scenario can be supported by the code in the current platform release and ESB trunk. -
12. Re: Validation
kconner Dec 3, 2008 5:57 AM (in response to r1c)"tfennelly" wrote:
So if the message was (for example) delivered via the file router, can this be used to validate the message?
In the sense that any router forwards to a subsequent service and that service would then be responsible for validation, yes."tfennelly" wrote:
Support for multiple schemas?
It only allows you to specify a single request schema, if that is what you are asking The schema is supposed to represent the contract of the service so the service is free to define alternatives within that schema if necessary.
If, however, you are asking whether a single service can support multiple, distinct, contracts then this is not possible with the current code. You would need to have the distinct contracts handled by distinct services. -
13. Re: Validation
r1c Dec 3, 2008 5:59 AM (in response to r1c)I apologise up front if I have missed something really obvious in the documentation.
The current trunk would therefore support something like the following
<actions inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd" validate="true"> <action ... /> <action ... /> </actions>
So schema validation can be applied to the action processing chain of any service in the ESB
Yes, this scenario can be supported by the code in the current platform release and ESB trunk.
Is this in release or trunk?
Where is this documented and is the validation performed around each action in the chain? -
14. Re: Validation
kconner Dec 3, 2008 6:14 AM (in response to r1c)"r1c" wrote:
I apologise up front if I have missed something really obvious in the documentation.
There is no reason to apologise for anything."r1c" wrote:
So schema validation can be applied to the action processing chain of any service in the ESB
That is correct, yes."r1c" wrote:
Is this in release or trunk?
It is not yet in a project release, ESB 4.5 will be the first project release to contain this code. This is available through the SOA platform however, as the work was originally driven through that release."r1c" wrote:
Where is this documented and is the validation performed around each action in the chain?
There should be documentation in the Programmer's Guide detailing our current work on service contracts.
The validation is specified at the service contract layer though, not around each action, as the actions are an integral part of the service and are free to make whatever changes they feel are necessary. It is when the response is returned to the caller that any response would be validated.