Boz*_*zho 9 java cxf jax-ws jaxb
拥有JAXB-RI和CXF.WSDL优先.我想要一个生成的类来实现Serializable.我现在有以下绑定xml,它可以工作(SEI类名称被更改)
<jaxws:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...>
<bindings node="wsdl:definitions/wsdl:portType[@name='Foo']">
<!-- change the generated SEI class -->
<class name="IFooService" />
</bindings>
</jaxws:bindings>
Run Code Online (Sandbox Code Playgroud)
不,在这种情况下,我应该添加的位置和内容.我试过了:
<xsd:annotation>
<xsd:appinfo>
<jaxb:globalBindings>
<xjc:serializable uid="12343" />
</jaxb:globalBindings>
</xsd:appinfo>
</xsd:annotation>
Run Code Online (Sandbox Code Playgroud)
和
<jxb:globalBindings>
<jxb:serializable/>
</jxb:globalBindings>
Run Code Online (Sandbox Code Playgroud)
<bindings>标记内部和外部- 要么Serializable未添加,要么根本不生成类(没有任何错误).
另见此主题
那么,究竟如何做到这一点
我以两种方式工作:
使用第二个绑定文件,只有JAXB,就像Pascal在他的回答中所显示的那样
通过指定<bindings>处理整个命名空间的另一个标记:
<bindings
node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://www.yoursite.com/services/mynamespace']">
<jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:serializable />
</jxb:globalBindings>
</bindings>
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
13841 次 |
| 最近记录: |