Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic questions - Question:JAX-WS Soap Faults not appearing in WSDL

I am creating a web service using JAX-WS (I am creating this using the Java to WSDL approach).

Im having trouble getting my exception to work as I require.

I have created the following exception class:

public class MyWebServiceException extends SOAPFaultException {

    private static final long serialVersionUID = 8234753208722614057L;

    protected MyWebServiceException(SOAPFault fault) {

    protected MyWebServiceException(SOAPFault fault, Throwable throwable) {

This allows me to have the following in my SOAP response:

Invalid Report

    " rel="nofollow" target="_blank">">
     Invalid Report

However, because my exception is a SOAPFaultException which extends RuntimeException, it is not being added to the WSDL, so when users of the service generate their client stubs the exception is not included.

Does anyone know how to create this exception to give me the intended output (ie including the faultcode and faultstring) but also appear in the WSDL (I guess it needs to be a checked exception)

I searched SO high and low to come up with what I have already!

asked Sep 13, 2013 in Core java by rajesh
edited Sep 12, 2013
0 votes

Related Hot Questions

Government Jobs Opening