}
if (context.isSOAP11()) {
if(log.isDebugEnabled()){
log.debug("context.isSOAP11() = true");
SOAPFaultCode code = (fault!=null)?fault.getCode():null;
SOAPFaultValue value = (code!=null)?code.getValue():null;
if(value !=null){
QName name = value.getQName();
log.debug("prefix ="+name.getPrefix());
log.debug("Fault Code namespace ="+name.getNamespaceURI());
log.debug("Fault Code ="+name.getLocalPart());
}
}
fault.getCode().setText(soapFaultCode);
} else {
if(log.isDebugEnabled()){
log.debug("context.isSOAP11() = false");
SOAPFaultCode code = (fault!=null)?fault.getCode():null;
SOAPFaultValue value = (code!=null)?code.getValue():null;
if(value !=null){
QName name = value.getQName();
log.debug("prefix ="+name.getPrefix());
log.debug("Fault Code namespace ="+name.getNamespaceURI());
log.debug("Fault Code ="+name.getLocalPart());
}
}
SOAPFaultValue value = fault.getCode().getValue();
if(log.isDebugEnabled()){
log.debug("soapFaultCode originally was set to : " + soapFaultCode);
}
OMNamespace namespace = value.getNamespace();
soapFaultCode = switchNamespacePrefix(soapFaultCode, namespace);
value.setText(soapFaultCode);
}
}
if (axisFault != null && !context.isSOAP11()) {
if (axisFault.getFaultSubCodes() != null) {
List faultSubCodes = axisFault.getFaultSubCodes();
QName faultSubCodeQName;
for (Object faultSubCode : faultSubCodes) {
faultSubCodeQName = (QName)faultSubCode;
SOAPFactory sf = (SOAPFactory)envelope.getOMFactory();
SOAPFaultSubCode soapFaultSubCode = sf.createSOAPFaultSubCode(fault.getCode());
SOAPFaultValue saopFaultValue = sf.createSOAPFaultValue(fault.getCode());
saopFaultValue.setText(faultSubCodeQName);
soapFaultSubCode.setValue(saopFaultValue);
fault.getCode().setSubCode(soapFaultSubCode);
}
}