Hi On Mon, Aug 9, 2010 at 3:40 PM, sivany [via CXF] < [email protected]<ml-node%[email protected]> > wrote:
> > Hi Sergey > > Thanks for the fast reply. > > was not that fast this time, sorry :-) > > >> 1) I also want to enable schema validation on the response object (java > >> to > >> xml), > >> Can you please show me how to do that? > >> Can this somehow be done in the javax.ws.rs.core.Response object? > >> I couldn't find solution for this anywhere... > >> > >> > > Not possible at the moment : you may want to try extending > > JAXBElementProvider and override its createMarshaller method and then > > setup > > the Marshaller to do the validation - let us know please if you can make > > it > > work and then JAXBElementProvider can get enhanced accordingly > > > > The overriding of createMarshaller method will not be a good solution for > me, > because this is done while the response is written to the stream. > I was looking for validations before the marshalling operation, > maybe in the setters of the returned object (by using the schema > annotations)? > Is this possible? > > At this stage I can only suggest adding a ResponseHandler filter and get the object from the input Response and validate it somehow. > > > >> Aug 4, 2010 9:43:43 AM org.apache.cxf.jaxrs.utils.schemas.SchemaHandler > >> createSchema > >> WARNING: Validation will be disabled, failed to create schema : > >> src-resolve.4.2: Error resolving component 'evns:ip'. It was detected > >> that > >> 'evns:ip' is in namespace 'EVGeneralSchema.xsd', but components from > this > >> namespace are not referenceable from schema document 'null'. If this is > >> the > >> incorrect namespace, perhaps the prefix of 'evns:ip' needs to be > changed. > >> If > >> this is the correct namespace, then an appropriate 'import' tag should > be > >> added to 'null'. > >> > >> Any ideas? > >> > > Please list the self-contained schemas first, listing EVGeneralSchema.xsd > > first should fix it > > > > I solved it - The problem was wrong path in the import tag, > I am using tomcat and I thought the relative path is from 'WEB-INF' > directory, > but it is from tomcat 'bin' dir. > > good, thanks for the confirmation Sergey > Thanks > > > ______________________________________ > This email was sent by sivany (via Nabble) > Your replies will appear at > http://cxf.547215.n5.nabble.com/problem-validating-response-with-schema-for-rest-services-jaxrs-tp2264992p2268924.html > To receive all replies by email, subscribe to this discussion: > http://cxf.547215.n5.nabble.com/template/NodeServlet.jtp?tpl=subscribe_by_code&node=2268924&code=dXNlcnNAY3hmLmFwYWNoZS5vcmd8MjI2ODkyNHwtMTA5NTcxOTE5Nw== >
