Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Return soap response after onComponentError on tESBConsumer and fault

Hi,

I need HELP !

This is my job :

0683p000009MFU7.png

After the onComponentError of the tESBConsumer I want to return a custom response but I don't know how to do that !!!

Thanks for your help !



Another question : it's possible to return a complete fault response like this ? =>

<soap:Envelope xmlns:soap="">
  <soap:Body>
     <soap:Fault>
        <soap:Code>
           <soap:Value>soap:Sender</soap:Value>
        </soap:Code>
        <soap:Reason>
           <!--1 or more repetitions:-->
           <soap:Text xml:lang="fr">3</soap:Text>
        </soap:Reason>
        <!--Optional:-->
        <soap:Node>4</soap:Node>
        <!--Optional:-->
        <soap:Role>5</soap:Role>
        <!--Optional:-->
        <soap:Detail>
           <!--You may enter ANY elements at this point-->
           <custum>myTest</custum>
        </soap:Detail>
     </soap:Fault>
  </soap:Body>
</soap:Envelope>

Because actually I receive response like this :

<soap:Envelope xmlns:soap="">
  <soap:Body>
     <soap:Fault>
        <soap:Code>
           <soap:Value>soap:Receiver</soap:Value>
           <soap:Subcode>
              <soap:Value xmlns:ns1="">ns1:businessFault</soap:Value>
           </soap:Subcode>
        </soap:Code>
        <soap:Reason>
           <soap:Text xml:lang="en">[tESBProviderFault_1]</soap:Text>
        </soap:Reason>
     </soap:Fault>
  </soap:Body>
</soap:Envelope>
Labels (4)
3 Replies
Anonymous
Not applicable
Author

I think it's work with this solution but maybe there is a better solution ... ?
the tLogCatcher catch tDie only, the tXMLMap create value for response ...

0683p000009MFUC.png

There is always my second question too ...
Anonymous
Not applicable
Author

For the second question there is a solution (perhaps not the best , and really very complicated for something that should be simple to perform normally if soap Fault were well manage ... )


tFlowIterate set in global memory the different elements of the fault structure generated by tESBConsumer.

tFixedFlowInput get in String the content of faultDetail.

tReplace delete XML header of this content ("<?xml version="1.0" encoding="UTF-8"?>").

tSetGlobalVar set in global memory in String the content of detail with add XML tags <soap: Detail> et <:soap: Detail>.

Second tFixedFlowInput get from global memory other Fault informations (code, reason (= faultString), node, rôle) in 4 String.

tXMLMap set this values in new soap fault message (structure was created by hand : create sub element on payload Document, add loop on soap:Fault, add namespace  with prefix soap, add attribut xml:lang). the attribut lang is set with « fr » because not give by fault structure generated by tESBConsumer. The values (code, reason, node, rôle) are mapping on this message.

tConvertType transform Document to String.

Second tReplace replace in the String tags soap: Detail empty with the String set in global memory by tSetGlobalVar. For the soap:Code we are replacing  "{}" by « soap : » to be identical to the original soapFault catch by tESBConsumer.

Second tConvertType transform String to Document.

Finaly Document is send by tESBProviderResponse.





0683p000009MFRt.png
atelesh
Contributor
Contributor

tESBProviderFault component has payload input field (XML document type) and in case value will be provided here it will be set as content of <soap: Detail>.
so for your case the value should be following XML document:

<custum>myTest</custum>


and for <soap:Node> & <soap:Role> elements - seems the only way is what you provided in last message (create complete <soap:Fault> document and return it with tESBProviderResponse) - but better create this document right in tXMLMap (so you won't need to make stuff like 'tReplace delete XML header of this content ("<?xml version="1.0" encoding="UTF-8"?>").')