简体   繁体   English

Java WSLD客户端运行中

[英]Java WSLD Client On The Fly

I have a maven project which contains a notification mechanism to customer's endpoint web service using the given wsdl location. 我有一个Maven项目,其中包含使用给定wsdl位置的客户端点Web服务的通知机制。

My question is that; 我的问题是; do I first need to create the client using the wsdl in another project and then import the client source to my project ? 我首先需要在另一个项目中使用wsdl创建客户端,然后将客户端源导入到我的项目中吗?

Or can I add a new maven module to my project and add the dependency of this new module to my main project so that I can easily use the methods of the wsdl. 或者,我可以向项目中添加新的maven模块,并将此新模块的依赖项添加至主项目,以便可以轻松使用wsdl的方法。 If second question's answer is "yes" then how can I do that ? 如果第二个问题的答案是“是”,那我该怎么办? should I create an initial build to be able to the java classes ? 我应该创建一个初始构建以能够使用Java类吗?

You can create a module, in your project, that represents the client's interface. 您可以在项目中创建一个表示客户端界面的模块。 You should use maven to generate the code in that module based on the wsdl. 您应该使用maven在基于wsdl的模块中生成代码。 The project type should be a jar. 项目类型应为jar。 You can then depend on that module/jar in the rest of your project. 然后,您可以在项目的其余部分中依赖该模块/ jar。 You then need to run a maven install, at least once, to generate the classes and build a jar for your repo. 然后,您需要至少运行一次maven安装,以生成类并为您的存储库构建一个jar。

The Apache CXF project has a maven plugin. Apache CXF项目具有一个maven插件。

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

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