• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAPFault

 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it required to put @WebFault annotation on an Custom Exception class(e.g MyException) for it to be considered as SOAPFault.

SEI:



SIB:






I am not getting SOAPFault if I omit @Webfault annotation.Could anyone please help?

 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using soapUI to test.


The corresponding client:

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2438
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Souvik Dasgupta wrote:
Is it required to put @WebFault annotation on an Custom Exception class(e.g MyException) for it to be considered as SOAPFault.
[/code]

No, did you check you WSDL?
 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In WSDL, I can see fault element in the messages section. But in soapUI tool I am not getting the SOAPFault.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2438
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you throw the AddNumbersException in your implementation?
 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yes
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2438
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure how the soapUI works, but do you use glassfish as a server?

Does the exception reach your client? Just put a try-catch statement around the web service invocation and see if you get the AddNumbersException? The exception should generated by wsimport if it is mentioned in your WSDL.
 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No I am using Tomcat.

But I will try it in Glassfish and let you know if I face the same issue.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2438
95
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use Glassfish, you don't need soapUI to dump messages, you can use:

A property that can be set programmatically on the server:
com.sun.xml.ws.transport.http.HttpAdapter.dump=true;

This is the equivalent property on the client:
com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic