• Post Reply Bookmark Topic Watch Topic
  • New Topic

Throwing/Handling SOAP Faults in JAX-WS Webservices  RSS feed

 
Srinath Kannan
Greenhorn
Posts: 14
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?

For example



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?


Please help in this regard.

Thanks
 
Lingan Rajan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinath

I think you are partially correct.
Hope the below link helps.
http://www.ibm.com/developerworks/webservices/library/ws-jaxws-faults/

Lingan
 
Srinath Kannan
Greenhorn
Posts: 14
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lingan

I am a novice in web services and i developed web services using code-first approach.

The link which you provided, i already seen it, its difficult to understand. Can you provide some other example?


 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!