You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@external.t-mobile.at on 2008/06/05 22:25:40 UTC
Antwort: schema validation & service list [Virus checked]
Hi again,
it there will be problem with 1) i'm thinking about creating a web page
(maybe extension of service list page) with possibility to simply switch
validation on and off per service (but also for client stubs)
my answer to 2) is yes ... if i can get the corresponding object.
e.g. in ServletController it's like
for (ServletDestination sd : destinations) {
((org.apache.cxf.transport.ChainInitiationObserver)sd.getMessageObserver()).getEndpoint()
and on this one i can call get / put
of course some NPE and classcast has to be avoided by some conditions, and
also it's not general solution.
but hopefully there is somewhere a list of all endpoints and conduits on
single place .. so i'm not dependent on transport etc. and i can configure
properties for endpoints and also for transports.
Is there?
another idea ...
checking if schema validation is enabled is done using code like this one:
Object en = message.getContextualProperty(Message.
SCHEMA_VALIDATION_ENABLED);
if (Boolean.TRUE.equals(en) || "true".equals(en)) {
... do something
}
my idea is to change this check to use e.g.
if (Boolean.TRUE.equals(en) || "true".equals(en) || ((en instanceOf !=
newXyzIntf) && (en.isDoValidation()))) {
then i can configure client and also provider endpoints with custom
objects (which could be registered somewhere on centralized place, and
from this place i can turn validation on and off).
maybe all of this is too custom and not good for cxf in general ... in
this case, just stop me.
best regards
jano
jan.minaroviech@external.t-mobile.at
06/05/2008 21:39
Bitte antworten an
users@cxf.apache.org
An
users@cxf.apache.org
Kopie
Thema
schema validation [Virus checked]
Hello,
1)
is it somehow possible to get marshaled xml, which was not valid when
schema validation was turned on and fault was generated because of this?
In fact i want to log this incorrect XML somehow, because from validation
error message it's sometimes (in very complex schemas) quite hard or
impossible to say what exactly was wrong.
I'm nearly sure that it wasn't possible in 2.1, because validation was
done on the fly as request was serialized. But maybe after Dans fix it's
possible now. .... ok I checked the change, and IMHO also now it's not
simply possible. If i want to do it, i have to hack
AbstractOutDatabindingInterceptor and in case of validation error to write
message once again without validation to temporary XmlStreamWriter and
then store it somewhere, so i can access it later.
2)
it it possible to programatically disable/enable schema validation
individually for each endpoint?
best regards
jano