Passing payload to tRESTClient as String instead of type Document

One Star

Passing payload to tRESTClient as String instead of type Document

/
Employee

Re: Passing payload to tRESTClient as String instead of type Document

Hi, you probably need to use the component that supports a direct DOM to String conversion (tXmlWriteOutput or similar) and then pass String to tRESTClient (set body type to String)
HTH, Sergey
One Star

Re: Passing payload to tRESTClient as String instead of type Document

/
Employee

Re: Passing payload to tRESTClient as String instead of type Document

Hi, sorry, I meant tWriteXmlField...Hmm, I'm actually not sure which component can be used to convert XML DOM to String...May be you need to introduce a tJava after tXmlMap and use DOM4J API to convert DOM to String.
tRESTClient itself has a body of type String. May be the reason you see this exception is that you still pass DOM to tRESTClient...
Cheers, Sergey
One Star

Re: Passing payload to tRESTClient as String instead of type Document

/
Employee

Re: Passing payload to tRESTClient as String instead of type Document

The problem is you have tXmlMap connected directly to tRESTClient, and tXMlMap produces DOM4J AFAIK....
You don;t really need tXmlMap unless you intend to pass Document to tRESTClient, if you have a String available then simply drop tXMLMap and pass it directly to tRESTClient bodySmiley Frustratedtring...
HTH, Sergey
One Star

Re: Passing payload to tRESTClient as String instead of type Document

/
Employee

Re: Passing payload to tRESTClient as String instead of type Document

Hi, passing DOM4J to tRESTClient or tRESTResponse relies on the ability of CXF-specific providers convert to XML or JSON string. So if you need to control the way String is created you need to do it in the studio
HTH, Sergey

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

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read