use of org.n52.shetland.w3c.soap.SoapFault in project arctic-sea by 52North.
the class Soap12Encoder method createSOAP12Fault.
private XmlObject createSOAP12Fault(final SoapFault soapFault) {
final FaultDocument faultDoc = FaultDocument.Factory.newInstance();
final Fault fault = faultDoc.addNewFault();
fault.addNewCode().setValue(soapFault.getFaultCode());
final Reasontext addNewText = fault.addNewReason().addNewText();
addNewText.setLang(soapFault.getLocale().getDisplayLanguage());
addNewText.setStringValue(soapFault.getFaultReason());
if (soapFault.getDetailText() != null) {
final XmlString xmlString = XmlString.Factory.newInstance();
xmlString.setStringValue(soapFault.getDetailText());
fault.addNewDetail().set(xmlString);
}
return faultDoc;
}
Aggregations