aspose file tools
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes SOAPFault Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "SOAPFault" Watch "SOAPFault" New topic
Author

SOAPFault

Souvik Dasgupta
Ranch Hand

Joined: Sep 24, 2009
Posts: 94


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?


Thanks and Regards
Souvik
SCJP, SCWCD, OCEJWSD
Souvik Dasgupta
Ranch Hand

Joined: Sep 24, 2009
Posts: 94


I am using soapUI to test.


The corresponding client:

Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 1968
    
  39

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

Joined: Sep 24, 2009
Posts: 94


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

Joined: Apr 07, 2010
Posts: 1968
    
  39

Do you throw the AddNumbersException in your implementation?
Souvik Dasgupta
Ranch Hand

Joined: Sep 24, 2009
Posts: 94


Yes
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper

Joined: Apr 07, 2010
Posts: 1968
    
  39

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

Joined: Sep 24, 2009
Posts: 94


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

Joined: Apr 07, 2010
Posts: 1968
    
  39

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;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SOAPFault