0 Replies Latest reply on Apr 10, 2013 8:53 AM by raghu85

    How to acheive SchemaValidation for webservice developed using bottom up approach(Java to WSDL)

    raghu85

      Hi all,

       

      We are following the bottom up approach for creating a webservice i.e., java pojo to wsdl...

      We are having Java pojo class where we are validating the feilds with annotations.

       

      @XmlType(name = "SchoolRequest")

      @XmlAccessorType(XmlAccessType.FIELD)

      @XmlRootElement(name = "createSchoolRequest")

      public class SchoolRequest extends AbstractValidator implements  SchoolDTO {

       

          /**

           *

           */

          private static final long serialVersionUID = 7363553823754379872L;

       

          @XmlElement(required = true)

          private String schoolCode;

          @XmlElement(required = true)

          @Pattern(regexp = "^[A-Z]+.*")

          @Size(min = 1, max = 80)   

          private String schoolName;

      .....

       

      And the webservice class we are using like

      @WebService(name = BeanNameConstants.SchoolServiceESBWS,

                  serviceName = BeanNameConstants.SchoolServiceESBWS,

                  portName = BeanNameConstants.SchoolServiceESBWS,

                  targetNamespace = BeanNameConstants.TARGET_NAMESPACE)

      public class SchoolServiceWS extends GenericAbstractWS implements

              SchoolServiceWSI {

         

       

          @WebMethod

          public CreateSchoolResponse createSchoolData(SchoolRequest pSchoolRequest)

                  throws Exception {

       

      Then we are deploying this stuff into JBoss 5.3.1 and we are using JBoss Web Services - Stack CXF Runtime Server 3.1.2.SP13.

       

      What we have to do inorder to achieve Schema validation for this approach.

       

      Note:

      We tried  Schema Validaiton for Top down approach using jbossws-cxf.xml configuration and it works fine.