How can I access this error text which is from wso2dss side standard error in WSO2 ESB fault sequence ERROR_CODE?
I am getting properly but this ERROR_MESSAGE giving NUll. How can I do this?
This is WSO2DSS standard ERROR message:
<soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Code>
<soapenv:Value>soapenv:Receiver</soapenv:Value>
</soapenv:Code>
<soapenv:Reason>
<soapenv:Text xml:lang="en-US" xmlns:xml="http://www.w3.org/XML/1998/namespace">The emp_DataService service, which is not valid, does not belong to the emp_DataService service group.</soapenv:Text>
</soapenv:Reason>
<soapenv:Detail/>
</soapenv:Fault>
I want to access the code of error as well as error text. Why? Because I need send a mail to backend department which will help them to trace a error as soon as possible.
How can I do this in WSO2ESB?
I want this two nodes to show:
<soapenv:Code> <soapenv:Value>soapenv:Receiver</soapenv:Value> </soapenv:Code>
2.
<soapenv:Text xml:lang="en-US" xmlns:xml="http://www.w3.org/XML/1998/namespace">The emp_DataService service, which is not valid, does not belong to the emp_DataService service group. </soapenv:Text>
How can I access this? Anyone know this?
In ESB as default the SOAP error is not recognized. It just passes it as a basic soap Message. In order to identify it as a SOAP_FAULT you should set the property
After wards it will trigger fault sequence for the incoming SOAP_FAULT. So you have to declare coming message is a SOAP_FAULT so you hace to say it is a SOAP_FAULT and force it to error sequence. This is explained in [1] a blog past my Amila.
For the second part of the question you can use payload Factory transformation. You can use following sequence.
canbe pointed to any of your email client. The given xpath directly pointing to the error message of the SOAP response you have posted in your question.
And to senf the email you can use wso2 esb mail transport in [2].
[1]. http://maharachchi.blogspot.com/2012/09/now-you-can-send-soapfaults-to-fault.html.
[2]. http://wso2.org/library/knowledge-base/use-mail-transport-esb-convert-soap-message-plain-text-mail
Please use the following code as the faultSequence.