【问题标题】:ws jaxb custom external mappingws jaxb 自定义外部映射
【发布时间】:2011-10-25 07:18:38
【问题描述】:

我必须自定义 JAXB 外部映射文件。 已经红色tutorial 关于这个并且找不到任何合适的 JAXB 自定义示例。我的场景是我有两个 WSDL 文件,主 WSDL 和辅助 WSDL,它们包含在主文件中。在辅助 WSDL 文件中有一个 complexType 定义,它有一个我想要自定义的名称。顺便说一句,该 complexType 的名称是 objectFactory。所以现在你知道我真正需要什么外部定制了。

我已经走了这么远,当我运行wsimport path-to-my-main-wsdl -b customBindings.jaxb 输出就像

[ERROR] XPath evaluation of "//xs:complexType[@name='objectFactory']" results in empty target node
line 2 of file:/customBindings.jaxb

文件customBindings.jaxb 看起来像

<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <jxb:bindings schemaLocation="path-to-my-secondary-wsdl#types?schema1" node="//xs:complexType[@name='objectFactory']">
        <jxb:class name="MyObjectFactory" />
    </jxb:bindings>
</jxb:bindings>

在我的customBindings.jaxb 文件的第二行是两个属性schemaLocationnode。属性schemaLocation 是否需要指向主 WSDL 或辅助 WSDl?属性node 是想要的 complexType 的确切路径(XPath)还是这样? XPath 中的命名空间是什么(node 属性),它必须是 xs 还是什么? typesschema1schemaLocation 中究竟代表什么?

谢谢

【问题讨论】:

    标签: binding wsdl jaxb wsimport


    【解决方案1】:

    我在研究同样的问题时遇到了你的问题。

    在这个页面上发现了一些模糊的提示:http://jaxb.java.net/guide/Dealing_with_errors.html

    “空目标节点”消息的原因在该页面的底部提出。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-24
      • 2011-11-07
      相关资源
      最近更新 更多