Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8159240

XSOM parser incorrectly processes type names with whitespaces

    XMLWordPrintable

Details

    • b01

    Backports

      Description

        The XMLSchema defines that whitespaces should be collapsed for type names and different attribute values that can contain type names. JAXB internal schema parser (XSOM) does not support this functionality. And it can cause failures in wsimport tool. WSDL file with such types definition section (space in 'type' attribute value):
          <wsdl:types>
            <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              targetNamespace="http://www.temp.com/Service/">
              <xsd:element name="HelloRequest" type="xsd:string"/>
              <xsd:element name="HelloResponse" type="xsd:string"/>
                  <xsd:complexType name="info">
                          <xsd:sequence>
                                <xsd:element name="firstname" type="xsd:string"/>
                                <xsd:element name="lastname" type="xsd:string"/>
                          </xsd:sequence>
                  </xsd:complexType>
                          
                  <xsd:complexType name="usage">
                          <xsd:all>
                                <xsd:element name="customerCharacteristics" type="hy:info "/>
                          </xsd:all>
                  </xsd:complexType>
            </xsd:schema>
          </wsdl:types>

        Causing the following wsimport failure:
        parsing WSDL...


        [ERROR] undefined simple or complex type 'hy:info '
          line 25 of file:/home/aefimov/Oracle/BUGS/JAX-WS_B/23559210_wsimport_spaces/sampleservice.wsdl.xml

        Exception in thread "main" com.sun.tools.internal.ws.wscompile.AbortException
        at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:129)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2283)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
        at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)

        XSOM parser should be modified to collapse whitespaces in type names in respect to XMLSchema types definitions (https://www.w3.org/2001/XMLSchema.xsd)

        Attachments

          Issue Links

            Activity

              People

                aefimov Aleksej Efimov
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: