How to configure JAXWS mapping of a SOAP operation whose name is reserved in Java

I am trying to compile wsdl from a JAX-WS 2.2.6 partner built into GlassFish 3.1.2.2 and get the following compilation error:

 [wsimport] [ERROR] Invalid operation "Void", it java reserved word, can't generate java method. Use customization to change the operation name.

So, I tried to map this operation name to a different Java method name through a special JAXWS binding file:

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

but it looks like this element not recognized:

 [wsimport] [ERROR] invalid extension element: "jaxws:method" (in namespace "http://java.sun.com/xml/ns/jaxws")

I got a little lost, as this is the correct namespace and exactly the same as described in section 9.2.7.1 https://jax-ws.java.net/nonav/2.2.6/docs/ch03.html#standard-customizations

This is not an xpath problem, as if I are modifying a node and then getting another error that "XPath evaluation leads to an empty node target".

Any idea? Thanks!

+4
1

, xPath. wsdl:binding wsdl:portType

wsdl:definitions/wsdl:portType[@name='xxx']/wsdl:operation[@name='yyy']
+1

All Articles