CXF Behaviour - Handling of Schema Violations in camel-cxf
Issue
- We have some queries regarding CXF and its handling of schema violations and the logging of those violations.
The solution we are currently developing on Fuse 6.1 is ‘CXF Web-service/Apache Camel - centric and includes a standard design principle that inbound message validation is divided between CXF SOAP Parser (for structural message defects) and specific camel route logic (for business-level validation checks).
-
Required Behaviour
- What we expect to see happen, when any of the CXF services receive a request message that is Malformed (incomplete/bad xml structure) or Violates a schema definition (missing mandatory parameter or malformed parameter according to any facet/pattern restriction) the CXF requestor parser ………..
- logs the error
- logs the request message
- rejects the request message
- returns an error to the requestor.
However, this is not the behaviour we are seeing in testing.
-
Observed Behaviour
What CXF appears to do is a bit inconsistent and unexpected…- CXF does recognise malformed requests and responds to the requestor with an http:500 error code (logging the error – but not the request – more of that later)
- CXF partially recognises schema-non-compliant requests (as it creates an Fuse Log entry for the violation – details of the request are not logged – more of that later), BUT responds to the requestor with an http:200 response code (ie. success) – This doesn’t seem correct.
-
Can you provide some guidance as to whether we have a configuration problem here, where we might need to change/set some config parameters ? Is it a CXF defect ?
However, if this is standard CXF behaviour, can you let me know what our options are for achieving our Required Behaviour (all 4 points). Whether this needs different config params, upgraded CXF version, custom extensions to CXF etc, or something completely different.
Environment
- Red Hat JBoss Fuse
- 6.x
- Apache CXF
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.