Here you can find the source of createException(String code, String message)
public static SOAPFaultException createException(String code, String message) throws SOAPException
//package com.java2s; //License from project: Open Source License import javax.xml.namespace.QName; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPFactory; import javax.xml.soap.SOAPFault; import javax.xml.ws.soap.SOAPFaultException; public class Main { private static SOAPFactory soapFactory; public static SOAPFaultException createException(String code, String message) throws SOAPException { SOAPFault fault = soapFactory.createFault(); fault.setFaultCode(new QName(code)); fault.setFaultString(message);//from w ww . j a va2 s. c o m return new SOAPFaultException(fault); } }