我正在尝试使用嵌入在 GlassFish 3.1.2.2 中的 JAX-WS 2.2.6 的合作伙伴编译 wsdl,并得到以下编译错误:
[wsimport] [ERROR] Invalid operation "Void", it's java reserved word, can't generate java method. Use customization to change the operation name.
所以我尝试通过自定义 JAXWS 绑定文件将此操作名称映射到另一个 Java 方法名称:
<?xml version="1.0" encoding="utf-8"?>
<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="https://partner.com/BasicOperationsService?wsdl">
<jaxws:bindings node="wsdl:definitions/wsdl:binding[@name='BasicHttpBinding_BasicOperations']/wsdl:operation[@name='Void']">
<jaxws:method name="voidTx"/>
</jaxws:bindings->
</jaxws:bindings>
但它似乎无法识别此方法元素:
[wsimport] [ERROR] invalid extension element: "jaxws:method" (in namespace "http://java.sun.com/xml/ns/jaxws")
我有点不知所措,因为这是正确的命名空间,并且与https://jax-ws.java.net/nonav/2.2.6/docs/ch03.html#standard-的第 9.2.7.1 节中的记录完全相同定制
这不是 xpath 问题,就像我更改节点一样,然后我收到另一个错误,即“XPath 评估导致空目标节点”。
任何想法?谢谢!