Search in sources :

Example 6 with SoapFault

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;
}
Also used : FaultDocument(org.w3.x2003.x05.soapEnvelope.FaultDocument) Reasontext(org.w3.x2003.x05.soapEnvelope.Reasontext) XmlString(org.apache.xmlbeans.XmlString) SoapFault(org.n52.shetland.w3c.soap.SoapFault) Fault(org.w3.x2003.x05.soapEnvelope.Fault)

Aggregations

SoapFault (org.n52.shetland.w3c.soap.SoapFault)6 SoapRequest (org.n52.shetland.w3c.soap.SoapRequest)3 QName (javax.xml.namespace.QName)2 IOException (java.io.IOException)1 Detail (javax.xml.soap.Detail)1 SOAPException (javax.xml.soap.SOAPException)1 SOAPMessage (javax.xml.soap.SOAPMessage)1 XmlString (org.apache.xmlbeans.XmlString)1 CodedException (org.n52.shetland.ogc.ows.exception.CodedException)1 NoApplicableCodeException (org.n52.shetland.ogc.ows.exception.NoApplicableCodeException)1 OwsExceptionReport (org.n52.shetland.ogc.ows.exception.OwsExceptionReport)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1 Fault (org.w3.x2003.x05.soapEnvelope.Fault)1 FaultDocument (org.w3.x2003.x05.soapEnvelope.FaultDocument)1 Reasontext (org.w3.x2003.x05.soapEnvelope.Reasontext)1