Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2855

WSDL2Java JAX-WS XJC customizations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.9
    • 2.2.10
    • Tooling
    • None
    • Moderate

    Description

      Configuration of a private customization implemented with XJC plugin architecture is not copied into customized WSDL. For instance:

      WSDL:

      <?xml version="1.0" encoding="UTF-8"?>

      <wsdl:definitions targetNamespace="http://some.ns.com/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">

      <types>
      <xsd:schema targetNamespace="http://some.ns.com/message"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns="http://www.w3.org/2001/XMLSchema">

      <element name="myMessage">
      <complexType>
      <sequence>
      <element name="number" type="int"/>
      </sequence>
      </complexType>
      </element>
      </xsd:schema>
      </types>

      <!-- Parts / ports definitions -->

      </wsdl:definitions>

      JAX-WS customization:

      <?xml version="1.0" encoding="UTF-8"?>

      <jaxws:bindings wsdlLocation="my.wsdl"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
      xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
      xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
      xmlns:my-xjc="http://some.ns.com/xjc"
      jaxb:version="2.0" jaxb:extensionBindingPrefixes="xjc my-xjc">

      <jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema">
      <jaxb:bindings node="xsd:element[@name='myMessage']//xsd:element[@name='numbers']">
      <my-xjc:somecfg a_param="a value"/>
      </jaxb:bindings>
      </jaxws:bindings>
      </jaxws:bindings>

      The problem is that the <my-xjc:somecfg/> element is not copied into the <annotation> of the respective element.

      Also the jaxb:extensionBindingPrefixes="" attribute is copied at the wrong place (on the myMessage element) additionally to the <xsd:schema/> element.

      Finally the WSDL2Java tool doesn't respect the proper format parsing the jaxb:extensionBindingPrefixes="" attribute (using comma-separated values instead of the whitespace separated list).

      I wrote a simple fix to these problems listed above but it could be improved to actually check better the validity of the xml elements.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            nitro.tm Antony Ducommun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: