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