Wednesday 21 June 2017

How to create a SOAP Fault in ESQL

A SOAP Fault is used to carry error information in a SOAP message.

A SOAP Fault has the following elements:

  • <faultcode> - mandatory element which provides information about the fault in a form that can be processed by the software. The values are:-
    • SOAP-ENV:VersionMismatch - invalid namespace for SOAP envelope.  
    • SOAP-ENV:MustUnderstand - a header was received that was targeted at the receiving node, marked mustUnderstand="true", and was not understood.
    • SOAP-ENV:Client - something went wrong on the receiver while processing the message, The message was incorrectly formed or contained incorrect. e..g the message could lack the proper authentication or payment information.The message was incorrectly formed or contained incorrect information.
    • SOAP-ENV:Server - There was a problem with the server, so the message could not proceed.The message could not be processed for reasons attributable to the processing of the message rather than to the contents of the message itself.
  • <faultstring> - mandatory element that provides information about the fault in a form intended for a human reader. 
  • <faultactor> - this element is intended to provide information about who caused the fault to happen within the message path. It is similar to the SOAP actor attribute but instead of indicating the destination of the header entry, it indicates the source of the fault. The value of the faultactor attribute is a URI identifying the source. Applications that do not act as the ultimate destination of the SOAP message MUST include the faultactor element in a SOAP Fault element. The ultimate destination of a message MAY use the faultactor element to indicate explicitly that it generated the fault 
  • <detail> - the element carries application-specific error information related to the <Body> element. It must be present if the contents of the <Body> element were not successfully processed.

Add the following code to a Compute node and then wire the SOAPInput node's catch terminal to the Compute node's in terminal.

DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/'; 
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.DoubleNamespaceDecl)xmlns:soap = soapenv; SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.faultcode = faultCode
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.faultstring = faultString
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:Fault.detail = detail;








No comments:

Post a Comment