[User] RESTBC - unexpected XML header when using text/plain

Dave Woodman dave at naffnet.org.uk
Thu Jul 12 18:04:27 BST 2018



Thanks for looking at this. 


In the use case I have, the REST service will be called by an already existing service which expects a string to be returned. 


The string itself will be the result of other BPEL steps, so all is normal there, and structured text is good 😊


My issue is that it is necessary to return the string only – the caller cannot cope with XML or JSON and expects a single string only.


Is it possible to obtain just the string from the structured text and send it back and the end of the process, as with the post example? Or am I just out of luck?




From: User <user-bounces at lists.open-esb.net> On Behalf Of jeanne ROMEFORT via User
Sent: 12 July 2018 17:27
To: user at lists.open-esb.net
Cc: jeanne ROMEFORT <jeannerom at aol.com>
Subject: [User] RESTBC - unexpected XML header when using text/plain


Hello Dave,

Further to your email, we tested the REST BC and tried to evaluate from where your issue comes from. 

As you can see below, we have the same issue than you because plain/text doesn’t have the necessary structure.


OpenESB uses XML as the communication standard and needs structured messages to communicate between components. So even when you define a simple String in your Mapper, it is and XML structure and consequently your Media type must be a structure such as JSON or XML and not a plain text.

In this case below, we send a request in text/plain with postman and send back a response in text/plain. If you do the test, you can notice that the string in the Mapper is not a string but a xop reference. In that case, you could get you want.  Nevertheless, you cannot use the fake string to concatenate it for Example since is it just a xop reference:

 We did not reproduce the Logicoy Case, but we think that we face the same issue.

So, we advise you to use XML or JSON as media type. It is difficult to imagine what means text/plain with a Structure. What elements should we display and with each order? 

We are working on REST BC bugs on when the body is in JSON, If the tests are conclusive, This format will be supported in future versions of OpenESB, which may be a solution to your problem.

Best regards, 



OpenESB developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.open-esb.net/pipermail/user/attachments/20180712/8de5cddc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 4712 bytes
Desc: not available
URL: <https://lists.open-esb.net/pipermail/user/attachments/20180712/8de5cddc/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 4709 bytes
Desc: not available
URL: <https://lists.open-esb.net/pipermail/user/attachments/20180712/8de5cddc/attachment-0001.jpg>

More information about the User mailing list