简体   繁体   English

建议使用哪种方法来构建WebService应用程序?

[英]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! 谢谢!

  1. 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的模块中。

  2. 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的生成方式。

  3. Import XSD into WSDL. 将XSD导入WSDL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从PHP 5.2运行Java的推荐方法是什么? - What's the recommended way of running Java from PHP 5.2? 使用Spring在后台运行进程的推荐方法是什么? - What's the recommended way to run processes in the background with Spring? 从 H2 1.3.175 迁移到 1.4.195 的推荐方法是什么 - What's the recommended way to migrate from H2 1.3.175 to 1.4.195 Java Swing客户端使用Web服务的最简单方法是什么? - What's the easiest way for a Java Swing client to consumer a webservice? Java Web App推荐的项目结构 - Java web app recommended project structure 在使用Apache的HTTP客户端时,将HTTP响应作为字符串的建议方法是什么? - What's the recommended way to get the HTTP response as a String when using Apache's HTTP Client? 从POST到http servlet读取xml的推荐/最快方法是什么? - What's the recommended / fastest way to read xml from a POST to an http servlet? 没有 function 指针,在 Java 中实现回调的推荐方法是什么 - 除了接口? - W/o function pointers, what's a recommended way to implement Callback in Java - other than interfaces? 在 Elastic Beanstalk 中设置 networkaddress.cache.ttl 的推荐方法是什么? - What's the recommended way to set networkaddress.cache.ttl in Elastic Beanstalk? 推荐的方法来保护 Web 服务? - Recommended ways to secure a webservice?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM