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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 77


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: 77


I am using soapUI to test.


The corresponding client:

Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

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: 77


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
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

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

Joined: Sep 24, 2009
Posts: 77


Yes
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

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: 77


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
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

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
 
Similar Threads
Java2WSDL command inside WebSphere how to use it!
Problem using JAXWS-RI sample code
how to Create web service from java source?
Having the user input numbers separated by commas
@WebMethod rules