I am completed developing web service using JAX-WS. Now i wanted to throw SOAPFault with customized error codes on certain conditions.
I gooogled on this topic, but i did not find any good/clear example to do this.
I need the following
1. A basic clear good example for throwing SOAPFault.
2. Why cant we just create custom exception classes by extending java.lang.Exception and annotating @webfault and throw this custom exception when required?
3. I read in some article that we need a bindings.xml file to configure and say the fault details? I did not understand this!
Also, its mentioned that @WebFault annotation should not be used by the programmer! Why?
What are the difficutlties you are facing in throwing custom exceptions in code first approach ?
If your implementation is throwing CustomExeption, the client would have access to that exception, once it generates the artifacts. Have you checked one of the exception classes that are generated after you did wsimport ?