* @param faultDesc
* @return
*/
protected SOAPFault writeSOAPFault(FaultDesc faultDesc) {
SOAPFault soapFault = new com.ibm.wsdl.extensions.soap.SOAPFaultImpl();
soapFault.setName(faultDesc.getName());
if (use != Use.ENCODED) {
soapFault.setUse("literal");
// no namespace for literal, gets it from the element
} else {
soapFault.setUse("encoded");
soapFault.setEncodingStyles(encodingList);
// Set the namespace from the fault QName if it exists
// otherwise use the target (or interface) namespace
QName faultQName = faultDesc.getQName();
if ((faultQName != null)
&& !faultQName.getNamespaceURI().equals("")) {
soapFault.setNamespaceURI(faultQName.getNamespaceURI());
} else {
if (targetService == null) {
soapFault.setNamespaceURI(intfNS);
} else {
soapFault.setNamespaceURI(targetService);
}
}
}
return soapFault;