开发者

ws jaxb custom external mapping

I have to do custom JAXB external mapping file. Already red tutorial about this and can not find any suitable example of JAXB customization. My scenario is that I have two WSDL files main WSDL and se开发者_JAVA百科condary WSDL which is included in main one. And in secondary WSDL file is one complexType definition which has a name that I want to customize. BTW name of that complexType is objectFactory. So now you know what I really really need that external customization.

I have came so far that when I run wsimport path-to-my-main-wsdl -b customBindings.jaxb output is like

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

File customBindings.jaxb looks like

<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>

At second line of my customBindings.jaxb file are two properties schemaLocation and node. Does property schemaLocation need to point at main WSDL or secondary WSDl? And does property node be exact path (XPath) to wanted complexType or is like this ok? And what is with namespaces within XPath (node property), it has to be xs or what? And what actually this types and schema1 stands for in schemaLocation?

thx


I came across your question while researching the same problem.

A few vague hints are found on this page: http://jaxb.java.net/guide/Dealing_with_errors.html

Causes for the "empty target node" message are suggested at the bottom of that page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜