Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6584507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:32:43+00:00 2026-05-25T16:32:43+00:00

I have a RESTful service that has a single path parameter and a parameter

  • 0

I have a RESTful service that has a single path parameter and a parameter that is unmarshalled from the request body. The request body parameter is XML for which I have an XSD. I’ve been trying to validate the XML payload against the XSD but to no avail. I’ve tried the following, as described here:

<jaxrs:server address="/"
    serviceClass="my.endpoint.class">
    <jaxrs:schemaLocations>
        <jaxrs:schemaLocation>classpath:schema/myschema.xsd</jaxrs:schemaLocation>
    </jaxrs:schemaLocations>
</jaxrs:server>

The schemas are being found (there are no errors at least) but what I expect to be an invalid payload is not throwing an exception. Parameters that don’t match the XSD contents are coming through as null. It may not be relevant but my auto-generated payload class has three attributes, some of which are required.

I’ve had a brief go at creating a MessageBodyReader, as described here but I think I’m having scope issues and my schema object is not available when readFrom is called.

Any help or suggestions would be gratefully appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:32:44+00:00Added an answer on May 25, 2026 at 4:32 pm

    Turns out the servlet I was using wasn’t accepting the jaxrs configuration shown above. I changed from using this:

    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    

    to this:

    <servlet-class>
        org.apache.cxf.transport.servlet.CXFServlet
    </servlet-class>
    <init-param>
        <param-name>config-location</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </init-param>
    

    Snippet of my applicationContext.xml

    <jaxrs:server address="/">
        <jaxrs:schemaLocations>
            <jaxrs:schemaLocation>classpath:schema/myschema1.xsd</jaxrs:schemaLocation>
            <jaxrs:schemaLocation>schema/myschema2.xsd</jaxrs:schemaLocation>
            <jaxrs:schemaLocation>schema/myschema3.xsd</jaxrs:schemaLocation>
        </jaxrs:schemaLocations>
    
        <jaxrs:serviceBeans>
            <bean class="my.package.endPoint1" />
            <bean class="my.package.endPoint2" /> 
        </jaxrs:serviceBeans>
    
        <jaxrs:features>
            <cxf:logging />
        </jaxrs:features>
    </jaxrs:server>
    

    Schema references are from the resources directory, adjacent to WEB-INF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ReSTful web service which needs to parse locale-sensitive data from the
I have a RESTful WCF web service that processes huge XML files that are
I have a RESTful WCF service that can return XML, JSON, or JSONP, depending
I have a RESTful WCF service that has an upload method accepting more than
I have a RESTful service that I am developing in WCF . I am
Let's say I have a RESTful, hypertext-driven service that models an ice cream store.
I have a web service site that is restful enabled, so other websites/ajax script
Greetings: I have put together a RESTful web service in .NET 3.5 that takes
I have a restful web service which can deal with DTOs in json format
I have two WCF RESTful services - the general service is public and has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.