One Star

[resolved] How to insert response and fault coming out from consumer into DB?

Hi,
I am trying to insert response and fault message of consumer. But there is no global variable in Talend for response and fault. I am also tried with another process like I put an tjavaRow in between consumer tResponseProvier or tFaultProvider and put the response or fault message in context. But that time OncomponentOk is not working for Response and In Fault case there is some string rather than document.
So please provide me some idea on inserting response or fault in DB. Thanks in advance.
Regards,
Sanjay
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] How to insert response and fault coming out from consumer into DB?

Hi
You can get the response or fault after tESBConsumer, link a response from tESBConsumer to a tXMLMap for parse the response and then store the value to a context variable on tJavaRow for use later.
tESBConsumer--response--tXMLMap--tJavaRow--oncomponent-->tFixedFlowInput--main--...
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
5 REPLIES
Community Manager

Re: [resolved] How to insert response and fault coming out from consumer into DB?

Hi
There are a Response schema on tESBConsumer for response, and a Fault schema for fault error, you can get the response or fault after the calling of web service, link a Response row after tESBConsumer to any a output component, for example:
tESBConsumer--response--tXMLMap--tMysqlOutput
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to insert response and fault coming out from consumer into DB?

Hi Shong,
This way only the response message can be inserted. But in my database there is also different field with this message field, which are necessary like:jobName, job_ID and also receiver information. Can you take a look of my posted picture with the topic?
Thanking you,
Regards,
Sanjay
Community Manager

Re: [resolved] How to insert response and fault coming out from consumer into DB?

Hi
You can get the response or fault after tESBConsumer, link a response from tESBConsumer to a tXMLMap for parse the response and then store the value to a context variable on tJavaRow for use later.
tESBConsumer--response--tXMLMap--tJavaRow--oncomponent-->tFixedFlowInput--main--...
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] How to insert response and fault coming out from consumer into DB?

Hi Shong,
Thanks. I am done. It's working fine now. One thing I want to tell you that in Talend, if there is '0' rows flowing but OnComponentOk is working. For that reason OnComponentOk is flowing for both Response and fault and every case values are inserted in DB.

When I put the DB insertion in main that time only my job is functionally running fine. Thanks by the way.
Regards,
Sanjay
Community Manager

Re: [resolved] How to insert response and fault coming out from consumer into DB?

great, thanks for your feedback!
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business