jax-ws
  1. jax-ws
  2. JAX_WS-1062

wsimport command will throw NullPointerException when no difination of like "xmlns:undns="http://test"" in WSDL file.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.6
    • Fix Version/s: 2.2.8
    • Component/s: wsimport
    • Labels:
      None
    • Environment:

      ALL

      Description

      Reappear Step
      1. Download the WSDL file I have uploaded
      2. excute the command like "wsimport D:\AddNumbers.wsdl"
      3. the command throw the NullPointerException .

      In factual, it shouldn't throw any exception if we haven't defined the attribute of xmlns:undns="http://test" in the property of input.

      1. AddNumbers.wsdl
        3 kB
        Jeremy_Lv
      2. WSDLParser.patch
        0.6 kB
        Jeremy_Lv
      1. screenshot-1.jpg
        159 kB

        Activity

        Hide
        Jeremy_Lv added a comment -

        <portType name="AddNumbersPortType">
        <operation name="addNumbers">
        <input message="tns:addNumbers" name="add" undefinedattribute="undefined"/>
        </operation>
        </portType>

        the attribute of xmlns:undns="http://test" isn't defined in property of input, the default of the attribute is null,so the exception throw out.

        Show
        Jeremy_Lv added a comment - <portType name="AddNumbersPortType"> <operation name="addNumbers"> <input message="tns:addNumbers" name="add" undefinedattribute="undefined"/> </operation> </portType> the attribute of xmlns:undns="http://test" isn't defined in property of input, the default of the attribute is null,so the exception throw out.
        Hide
        Jeremy_Lv added a comment -

        the command excute successfully when the property defined as follows

        <portType name="AddNumbersPortType">
        <operation name="addNumbers">
        <input message="tns:addNumbers" name="add" undns:undefinedattribute2="undefined" xmlns:undns="http://test"/>
        </operation>
        </portType>

        Show
        Jeremy_Lv added a comment - the command excute successfully when the property defined as follows <portType name="AddNumbersPortType"> <operation name="addNumbers"> <input message="tns:addNumbers" name="add" undns:undefinedattribute2="undefined" xmlns:undns="http://test"/> </operation> </portType>
        Hide
        Jeremy_Lv added a comment -

        the exception occurs because in the method called checkNotWsdlAttribute(Attr a) in WSDLParser.java doesn't judge whether the value of a.getNamespaceURI() is null.

        Show
        Jeremy_Lv added a comment - the exception occurs because in the method called checkNotWsdlAttribute(Attr a) in WSDLParser.java doesn't judge whether the value of a.getNamespaceURI() is null.
        Hide
        Jeremy_Lv added a comment - - edited

        changed the method called checkNotWsdlAttribute(Attr a) in WSDLParser.java as follws:

        private void checkNotWsdlAttribute(Attr a)

        { // possible extensibility element -- must live outside the WSDL namespace if (Constants.NS_WSDL.equals(a.getNamespaceURI())) errReceiver.error(forest.locatorTable.getStartLocation(a.getOwnerElement ()), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(a.getLocalName())); }
        Show
        Jeremy_Lv added a comment - - edited changed the method called checkNotWsdlAttribute(Attr a) in WSDLParser.java as follws: private void checkNotWsdlAttribute(Attr a) { // possible extensibility element -- must live outside the WSDL namespace if (Constants.NS_WSDL.equals(a.getNamespaceURI())) errReceiver.error(forest.locatorTable.getStartLocation(a.getOwnerElement ()), WsdlMessages.PARSING_INVALID_WSDL_ELEMENT(a.getLocalName())); }
        Hide
        Jeremy_Lv added a comment -

        I revised the issue in WSDLParser.patch file , I wonder if you can review of it .

        Show
        Jeremy_Lv added a comment - I revised the issue in WSDLParser.patch file , I wonder if you can review of it .
        Show
        Lukas Jungmann added a comment - http://java.net/projects/jax-ws/sources/sources/revision/13698

          People

          • Assignee:
            Lukas Jungmann
            Reporter:
            Jeremy_Lv
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: