Search code examples
jax-ws

"_Exception" appended to the JAX-WS generated exception classes


I ran wsimport tool to create client code from wsdl, all client code generates as successfully, however, exception classes have wired names as follows.

ProductSupplierException_Exception.java
UnknownProductException_Exception.java
OutOfStockException_Exception.java

All exception classes have "_Exception" appended to the end of the class name.

using jdk: 1.6.

This is how i define exception in wsdl/xsd

WSDL:

<message name="InvalidDetailsException">
<part name="fault" element="tns:InvalidDetailsException"></part>
</message>

XSD:

<xs:element name="InvalidDetailsException" type="tns:InvalidDetailsException" />

<xs:complexType name="InvalidDetailsException">
<xs:sequence>
<xs:element name="message" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>

any help would be much appreciated


Solution

  • wsimport appends _Exception to the exception classes that generated from this WSDL, because their names is clashed.

    See Also: