• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to Handle SOAP Fault in SOAP based Webservices

 
Greenhorn
Posts: 18
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I wanted to Handle the SOAP Fault code (SOAPFaultException) , if any one know please update reply. The application code is available blow, you can use this simple example and demonstrate where to plug the code.
If I am deploying this code by using cxf please guide where to do changes.
To deploy above example as web application we need to do the modification in context file (I am using cxf.xml) and web.xml, Please find the file content below.
 
Azahrudhin Mohammad
Greenhorn
Posts: 18
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please reply how to implement or handle javax.xml.ws.soap.SOAPFaultException provided by JAX-WS.
 
Azahrudhin Mohammad
Greenhorn
Posts: 18
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to implement the soap fault, Please find the process below.
01. Write your own fault code class using WebFault annotation
@WebFault(name = "CustumFault", targetNamespace = "http://soapfault.jaxws.soap.example/")
public class CustumFault extends Exception {

private String faultInfo;
public CustumFault(String message, String faultInfo){
super(message);
this.faultInfo = faultInfo;
}
}

02. Your service and implementation should throw the exception
@WebMethod
public String sayHello(String name) throws CustumFault;
03. Throw the exception from the implementation of service
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!