I have an XSD describing the service in some legacy system (lets call it A24). We use JAXB to translate this XSD to开发者_开发百科 Java POJOs, then we generate the @WebService
annotated Web service class (this is done on the fly using template). Using Metro we create a WAR file and deploy the Web service. So the Web service is created using the bottom up approach (write implementation first).
Metro automatically creates a WSDL and XSD for the Web service using internal JAXB. However the WSDL and schema generated by Metro are lacking restrictions like string lengths etc. But my requirement is to create a Web service which can support strong data type validation. How can I achieve this?
One obvious solution is to change the approach and write WSDL first, then the implementation, but is there a way to write the implementation first and still generate WSDL + XSD which will contain validation rules?
精彩评论