问题标签 [jaxws-maven-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
118 浏览

maven - 具有多个 wsdl 文件的相对 wsdlLocation

我正在使用jaxws-maven-plugin从多个 wsdl 文件生成类。这是我的插件配置:

每个生成的客户端代码都有以下注释,其中包含 wsdl 文件的绝对路径:

使用wsdlLocation属性,我可以使这个路径相对(wsdl 文件包含在我的目标 war 文件中)。我应该如何应用wsdlLocation属性来处理多个 wsdl 文件?

0 投票
1 回答
1158 浏览

java - jaxws-maven-plugin 多次执行不起作用

我想为多个 WSDL 生成 java 类。由于不同模式中的名称冲突,每个 WSDL 都应该在一个 java 包中。我在我的 pom.xml 中创建了以下执行:

但显然找不到 WSDL 位置:

我不明白,为什么这个例子不起作用。配置似乎是有效的(参见Multiple WSDLs Configurations With Maven JAXWS

如果我将configuration元素向上移动两层,它就可以工作!(但我只能配置一个执行......)

任何解决方案的想法都非常感谢!

(PS Java 8,Maven 3.6.2)

0 投票
0 回答
1056 浏览

maven - Maven doesn't recognize jaxws-ri version

I'm very new to Web development, but I can't figure out what's happening here:

pom.xml file not recognizing version

I'm working on a project with multiple repositories, that depend on each other. All my repositories can be seen on the left of the image there, and the dependencies go: utils > dao > base_services > api_rest > integradores > geracao_de_boletos > ws > webjar >web (where web depends on all that came before it to work).

All was cool until, for some god forsaken reason, a dependency I used called 'Jrimum' simply stopped working. It was no big deal, since they have a rival that does the exact same thing, so I just took a day to migrate from one to the other and thought that was that.

Except out of nowhere, when I try to perform Maven's clean/ install protocol, now ANOTHER dependency has an error, that, as far as I know, didn't have the error before!

That's the dependency you see on screen there: "jaxws-ri". When I run mvn clean install, the following error appears:

"Failure to find com.sun.xml.ws:jaxws-ri:pom:2.3.3-b01 in https://repository.jboss.org/nexus/content/repositories/releases was cached in the local repository, resolution will not be reattempted until the update interval of org.jboss.repository.releases has elapsed or updates are forced"

Now, this bogles my mind, because, if I go to the original Maven dependency website (https://mvnrepository.com/artifact/com.sun.xml.ws/jaxws-ri),the version exists there (Mind the edit at the end of the post!) Now, I know the version that I'm trying to use seems a little dodgy, but I've tried other versions on my POM file and it doesn't recognize them either.

Maven version is 3.6.1 and IDE is Intellij Ultimate.

EDIT: So, apparently, the website I thought to be the original Maven sources, isn't! Instead, I've been directed to "https://search.maven.org/artifact/com.sun.xml.ws/docs/2.3.3-b01/pom" (thanks to user khmarbaise by the way). And when I ctrl C + ctrl V the Maven dependency example, it fixes my initial problem, which is absolutely great! But it also creates a bunch of other problems on other libraries...

(Error message seen on screen is "bad path element "C:\Users\Dunning.m2\repository\com\mchange\c3p0\0.9.5.3\mchange-commons-java-0.2.15.jar": no such file or directory")

So, my new question is: do dependencies have other dependencies? Is the error being caused because this dependency that got added (properly now), has other dependencies of it's own?

0 投票
2 回答
128 浏览

soap - JAXWS 客户端总是发送 HTTP 而不是 HTTPS

嗨,我在我的 java 项目中使用 jaxws 生成 wsdl。我使用 java 11 和 jaxws-maven-plugin 导入 mywsdl Myproblem 在我的 wsdl 中有一个http://myservice块。我想使用https://myservice作为网址。我生成并导入 wsdl。这总是试图到达 http 地址而不是 https。如何强制我的 webclient 使用 http 地址。

0 投票
0 回答
181 浏览

spring - 我们可以改变动态 - 使用 JAX-WS

我是soap Web服务的新手,想知道我们可以根据部署的环境更改soap的位置:地址。我正在使用 jaxws-spring

0 投票
1 回答
70 浏览

jaxb - JAXB 解组对象并添加原始 xml

在我们的 java/spring 项目中,我们将 JAXB 2.0 与 JAX-WS 结合使用来接收一些 SOAP 请求。目标不仅是将有效负载解组为 java bean,而且还将原始 xml 消息保存在该 java bean 上。有没有办法做到这一点?加分点:如果解决方案与 jaxws-maven-plugin wsimport 目标一起使用。

0 投票
1 回答
677 浏览

java - 如何让 JAXB 为非字符串元素生成空标签?

编辑:我已经重新格式化了这个问题,希望能让我的意图更清楚。

我正在尝试使用 JAXB 编组器将 java 对象映射到 XML,以创建对供应商 SOAP 服务的肥皂请求。我几乎没有需要在请求中显示的元素,即使它们为空或为空。我在 pom.xml 中使用jaxws-maven-plugin带有目标的插件wsimport来从 WSDL 文件生成源。

我从这里 [https://stackoverflow.com/questions/11215485/jax-ws-to-remove-empty-tags-from-request-xml] 阅读并理解,对于具有xs:string类型的元素,空标签可以通过设置一个空字符串""作为它的值来生成。但它不能对具有诸如xs:dateTime, xs:boolean, xs:integerwhich 将XMLGregorianCalendar, BigInteger, Boolean分别产生对象的类型的元素进行。如果我将它们的值设置为 null,则不会在编组过程中生成元素。就像其他人指出的那样,它可以通过添加nillable=true来实现,@XmlElement但这将需要更改生成的源代码,除非我在第一次构建后从 maven 中删除插件,否则它将在下一次构建时被覆盖。

我当前的解决方法是将请求中需要显示的特定元素的类型更改为xs:stringWSDL 文件,并将空字符串传递给它们相应的 java 对象字段。

我的问题是,是否可以在 WSDL 端进行更改以触发 jaxws:wsimport 添加nillable=true到生成的@XmlElement字段中?我更喜欢更改 WSDL 文件而不是生成的源的原因是

  1. 我已经对 WSDL 文件进行了一些更改,以便所有更改都可以放在一个地方,更容易记录。
  2. 我想避免更改生成的源,以便我可以将它们排除在 Git 存储库之外,并防止在每次构建时被覆盖。

以下是代码的简化版本。

首先,我为 complexType Currency 生成了这个 java 类。

我将字段设置为空,因为它们不存在。

这将生成 <typ:Currency /> 但我需要像下面那样生成它。

0 投票
0 回答
64 浏览

java - 如何从 wsdl 和额外的 xsd:s 生成带有 jaxws-maven-plugin 的 java 客户端?

我即将从 wsdl 为一个服务生成一个 java 客户端,该服务也可能返回未从 wsdl 引用的外部 xsd:s 中发现的子类。

如果我使用 jaxws-maven-plugin 从 wsdl 生成,我只会得到从 wsdl 显式引用的类。

所以在某种程度上我需要告诉 jaxws-maven-plugin 也从一些额外的 xsd:s 生成。

我设法将外部 xsd:s 中的类生成到另一个 maven 项目中,但在运行时它说找不到某些类型。所以我想他们都需要存在于同一个罐子里。

最好的问候弗雷德里克

0 投票
1 回答
440 浏览

jax-ws - jaxws:它不是 jaxws 或 jaxb 绑定文件

我收到此错误消息:

[警告] 忽略:绑定文件“file:/home/jeusdi/projects/salut/hes/hes-visor-api-service/src/jaxws/bindings.xml”。它不是 jaxws 或 jaxb 绑定文件

它告诉我我的binding.xml文件无效,它将被载入。

我的binding.xml文件内容是:

有任何想法吗?

0 投票
1 回答
3748 浏览

java - 使用 JDK 1.8 编译期间出现“调用 com.sun.tools.ws.wscompile.WsimportTool 失败”错误

我正在开发一个项目并尝试从编译器版本迁移。从 JDK 1.7 到 1.8。在构建过程中,我在其中一个模块上收到了以下错误,但我无法解决它。

我正在使用IntelliJ,我的Maven版本是3.6.3.

这是我的 pom.xml 的相关部分:

到目前为止,我已经尝试过,

-更新插件配置如下

- 将 jaxws-maven-plugin 的版本更改为 2.4.1 并添加以下 dep。到插件

- 不仅要构建该模块,还要构建整个项目。

- 从本地 repo m2 中删除 jaxws-maven-plugin 和 jaxws-tools 文件夹。

- 检查 JAVA_HOME 路径以查看是否指向 JDK1.8。检查项目SDK(JDK 1.8)

这些都是这里主要提到的。

这些都没有帮助。