Hi Sivan

sorry for a delay...

On Thu, Aug 5, 2010 at 7:16 AM, Sivan Yogev <[email protected]> wrote:

> Hi-
>
> I tried to post this in the cxf forum, but I keep seeing that the message
> is in status 'pending',
> So I am sending it manually.
> I am trying to implement CXF framework for REST services (jaxrs) without
> spring.
> I followed the examples, and managed to receive xml message in the request,
> and then validate the xml according to a schema defined in web.xml file, and
> get the correct object in the service.
> Now I have 2 problems:
>
> 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


> 2) For the incoming xml message I have 2 schemas - one depends on the other
> (Registration.xsd uses tags that is located in EVGeneralSchema.xsd).
> I defined both of them in web.xml:
> <init-param>
>      <param-name>jaxrs.schemaLocations</param-name>
>      <param-value>
>        classpath:/schemas/Registration.xsd
>        classpath:/schemas/EVGeneralSchema.xsd
>      </param-value>
>     </init-param>
>
> I added the 'import' tag in Registration.xsd, but I keep getting the
> following exception:
>
> 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

cheers, Sergey


> Thanks a lot
> Sivan
>
> Sivan Yogev
> Software Engineer - ExpandView Team
>
> EXPAND NETWORKS | SMARTER NETWORKS, FASTER APPLICATIONS(tm)
>
> 6 Hanechoshet Street | Tel Aviv, Israel 69710
> V: +972.3.766.8050 | F: +972.3.766.8001 | M: +972.52.386.9139
> [email protected]<mailto:[email protected]> | http://<
> http://www.expand.com/>www.expand.com<http://www.expand.com/>
>
> Gartner Report:
> Expand Networks Positioned in the Leaders Quadrant of Gartner's Magic
> Quadrant <
> http://www.expand.com/newsletters/newCollateral-registration.aspx?promotion=gartner07
> >
>
> Learn More About Expand Networks' WAN Optimization Through Our New Videos:
> Optimizing Citrix and RDP<
> http://www.expand.com/video/player.aspx?loc=citrix> | Server
> Consolidation<http://www.expand.com/video/player.aspx?loc=sc> | Optimizing
> Satellite Communications<
> http://www.expand.com/video/player.aspx?loc=satellite2>
>
>

Reply via email to