Issue Details (XML | Word | Printable)

Key: JAX_WS-1062
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Lukas Jungmann
Reporter: Jeremy_Lv
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jax-ws

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

Created: 13/Apr/12 07:43 AM   Updated: 16/Jan/13 04:45 PM   Resolved: 16/Jan/13 04:45 PM
Component/s: wsimport
Affects Version/s: 2.2.6
Fix Version/s: 2.2.8

Time Tracking:
Not Specified

File Attachments: 1. XML File AddNumbers.wsdl (3 kB) 13/Apr/12 07:43 AM - Jeremy_Lv
2. Text File WSDLParser.patch (0.6 kB) 15/May/12 12:00 PM - Jeremy_Lv

Image Attachments:

1. screenshot-1.jpg
(159 kB)
Environment:

ALL


Tags: metro2_2_1-waived
Participants: Jeremy_Lv and Lukas Jungmann


 Description  « Hide

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.



Jeremy_Lv added a comment - 13/Apr/12 07:47 AM

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


Jeremy_Lv added a comment - 13/Apr/12 08:25 AM

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>


Jeremy_Lv added a comment - 13/Apr/12 08:33 AM

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.


Jeremy_Lv added a comment - 16/Apr/12 05:09 AM - 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())); }


Jeremy_Lv added a comment - 15/May/12 12:00 PM

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