Return soap response or fault after insert to database

Highlighted
Six Stars

Return soap response or fault after insert to database

Hello.

I'm new in TOS.
I created service which has few fields in request. 
I managed to insert these fields to database using tXMLMap and tDBOutput.

Now what I want to do is return soap response when there is no error during inserting to database otherwise return fault message.
Which component should I use?
I cannot use triggers from tDBOutput to tESBProviderResponse


Accepted Solutions
Employee

Re: Return soap response or fault after insert to database

Hi,

 

   Could you please try this method? You can create a message using tRowgenerator and convert it to appropriate format before sending as either response or fault.

 

   Please note that the number of records in tRowgenerator must be 1 instead of default value of 100.

 

image.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post


All Replies
Employee

Re: Return soap response or fault after insert to database

Hi,

 

   Could you please try this method? You can create a message using tRowgenerator and convert it to appropriate format before sending as either response or fault.

 

   Please note that the number of records in tRowgenerator must be 1 instead of default value of 100.

 

image.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

Six Stars

Re: Return soap response or fault after insert to database

Thanks for replay, but...
While inserting into database I get error "Violation of PRIMARY KEY constraint" and it's not recognized as SubjobError

Six Stars

Re: Return soap response or fault after insert to database

Problem was in Die on error in DBOutput.
Thank you

Six Stars

Re: Return soap response or fault after insert to database

I still have problem to get response or fault.

In case of database error, flow goes to tESBFaultProvider but I don't get any message in SoapUI as response. And I get error:

"Exception in component tESBProviderFault_1 (AddFileTaskLogging)
java.lang.RuntimeException: Send Response failed! Response already sent with current request."

Przechwytywanie.PNG

 

Employee

Re: Return soap response or fault after insert to database

Hi,

 

    It could be because your trowgnerator may have multiple records getting generated. Could you please verify whether its having default value of 100?

 

    Please also check the below link which has been solved for similar issue.

 

https://community.talend.com/t5/Design-and-Development/Send-Response-failed-Response-already-sent-wi...

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Six Stars

Re: Return soap response or fault after insert to database

In tRowGenerator number of rows is set to 1.
I also changed All in one to true but I don't think I does make sens.
I return static response "Ok" or "Error".
One thing I've noticed is that I get sql exception immediately and after a while (probably timeout ?) I get 
java.lang.RuntimeException: Send Response failed! Response already sent with current request.

 

Second case is more confusing:
In case of proper insert to database, flow goes to DBOutput and hang for a while, then I get Timeout exception, and flow goes to onSubjibError

Six Stars

Re: Return soap response or fault after insert to database

Everything works good on runtime.
Thanks for help

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog