How can I throw exceptions using JAX-WS 2.0?

I have been using NetBeans5.5 to develop a web service from a WSDL i.e. I write the XSD and WSDL first then generate the web service code in NetBeans5.5. How can I throw an exception so that details of the exception will be contained within the SOAP xml response? For example:

<soapenv:Body>

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<faultcode>MyFaultCode</faultcode>

<faultstring>MyFaultString</faultstring>

</soapenv:Fault>

</soapenv:Body>

In the above sample message FaultCode and FaultString would be something that I can specify, perhaps the contents of another caught exception. I really need to have some way to display meaningful data to anyone which consumes this web service and where an exception occurs.

[870 byte] By [ryanmccolluma] at [2007-11-27 2:48:39]
# 1
You can throw a javax.xml.ws.soap.SOAPFaultException. https://jax-ws.dev.java.net/nonav/jax-ws-20-fcs/api/javax/xml/ws/soap/SOAPFaultException.html
dkohlerta at 2007-7-12 3:19:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...