简体   繁体   English

WSDL到java代码方法生成额外的类

[英]WSDL to java code approach generating extra classes

Initially I have used bottom-up approach (Code to WSDL) to generate a wsdl file using three classes. 最初我使用自下而上的方法(Code to WSDL)使用三个类生成wsdl文件。

Now using the generated wsdl file I am trying to create the code ie top down approach using eclipse and its creating lot of classes than what I have used initially to create a wsdl file. 现在使用生成的wsdl文件,我试图创建代码,即使用eclipse自上而下的方法,并创建了许多类,而不是我最初用来创建wsdl文件。 How do I get rid of unnecessary classes and get the original classes which I have written? 如何摆脱不必要的课程并获得我编写的原始课程?

You will most likely never get the precise original code if you go with code -> generate WSDL from code (eg jax-ws) -> generate code from WSDL (eg wsimport) and that is fine because WSDL-driven development and it's counterpart are two different approaches. 如果你使用代码 - >从代码生成WSDL(例如jax-ws) - >从WSDL生成代码(例如wsimport),你很可能永远不会得到精确的原始代码,这很好,因为WSDL驱动的开发和它的对应物是两种不同的方法。

With WSDL-driven approach your specify your WSDL contract first and then usually would generate you server/client code from the contract. 使用WSDL驱动的方法,首先指定您的WSDL合约,然后通常会从合同中生成服务器/客户端代码。

With code-first approach you define the service and it's operations in Java and would usually rely on a framework to generate the final WSDL. 使用代码优先方法,您可以使用Java定义服务及其操作,并且通常依赖于框架来生成最终的WSDL。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM