• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Handle SOAP Fault in SOAP based Webservices

 
Greenhorn
Posts: 18
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic