gpt4 book ai didi

java - (Axis + Jetty) Prefix 自动生成的前缀命名空间

转载 作者:行者123 更新时间:2023-12-01 15:13:19 24 4
gpt4 key购买 nike

我需要一个旧软件(不是我开发的)来测试旧设备。设备通过网络服务与服务器“对话”。这些 Web 服务由 axis 自动生成(Axis 采用一个类并通过其方法创建 Web 服务)。

问题是:设备被开发来读取这样的 xml:

<ns:getReferenceCurveResponse xmlns:ns="http://services.teste.org" xmlns:ax22="http://data.teste.org/xsd" xmlns:ax23="http://util.java/xsd">  
<ns:return type="org.teste.ReferenceCurve">
<ax21:createdOn>2012-08-16 17:00:59.0</ax21:createdOn>
<ax21:endPoint>9.2</ax21:endPoint>
<ax21:fiberId>21</ax21:fiberId>
<ax21:id>42</ax21:id>

现在网络服务是这样的:

<ns:getReferenceCurveResponse xmlns:ns="http://services.teste.org" xmlns:ax22="http://data.teste.org/xsd" xmlns:ax23="http://util.java/xsd">  
<ns:return type="org.teste.ReferenceCurve">
<ax22:createdOn>2012-08-16 17:00:59.0</ax22:createdOn>
<ax22:endPoint>9.2</ax22:endPoint>
<ax22:fiberId>21</ax22:fiberId>
<ax22:id>42</ax22:id>

正如您所注意到的,命名空间中的前缀已从 ax21 更改为 ax22,由于设备被编码为前缀 ax21,因此会产生错误。

我已经寻找解决方案但找不到。我重新编译了服务器端,也没有成功。我找不到任何地方可以更改此命名空间前缀,因为它是由 Axis2 自动生成的

最佳答案

好吧,它已经徘徊了一天,所以我会用完全错误的方式来处理这个 jetty ,因为 jetty 是这里的标签之一

您可以使用 servlet 过滤器并动态调整响应来解决该 namespace 问题....但这将是非常糟糕的:)

祝你好运!

关于java - (Axis + Jetty) Prefix 自动生成的前缀命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12006782/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com