[英]What's the recommended way to structure WebService app?
In a Java webapp, is there a best practice for storing XSD files and wsdl files? 在Java Webapp中,是否存在存储XSD文件和wsdl文件的最佳实践?
1) What folder structure should be used storing XSD and WSDLs? 1)应该使用哪种文件夹结构来存储XSD和WSDL? (This is for an app that is a 'Consumer' as well as 'Producer' of WebServices). (这适用于既是Web服务的“消费者”又是“生产者”的应用程序)。
2) Should we use one-time generated POJOs, or should we write add a Maven Plugin (or Ant) that auto generates the POJOs before each time "compile" task is invoked. 2)我们应该使用一次性生成的POJO,还是应该编写添加一个Maven插件(或Ant)来在每次调用“编译”任务之前自动生成POJO。
3) Should we have contents of XSDs files pasted into WSDLs? 3)是否应该将XSD文件的内容粘贴到WSDL中? or should the WSDLs "import" the XSD files? 还是WSDL应该“导入” XSD文件?
thanks! 谢谢!
The best would be to create a dedicated project/library that only stores xsd and wsdl files and add it as dependency to module where you want to generate POJOs. 最好的办法是创建一个仅存储xsd和wsdl文件的专用项目/库,并将其作为依赖项添加到要生成POJO的模块中。
Maven plugins are already available, for example cxf-codegen-plugin or wsdl2java-maven-plugin. Maven插件已经可用,例如cxf-codegen-plugin或wsdl2java-maven-plugin。 These are working well and you can customize how POJOs are generated. 这些效果很好,您可以自定义POJO的生成方式。
Import XSD into WSDL. 将XSD导入WSDL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.