RESTBC - unexpected XML header when using text/plain

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
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.
Sans titre.png

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:
Sans titre.png
 
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,
 
Jeanne ROMEFORT, 
OpenESB developer
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list

Hi,

 

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?

 

                Dave.

 

From: User <[hidden email]> On Behalf Of jeanne ROMEFORT via User
Sent: 12 July 2018 17:27
To: [hidden email]
Cc: jeanne ROMEFORT <[hidden email]>
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.

Sans titre.png

 

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:

Sans titre.png

 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,

 

Jeanne ROMEFORT, 

OpenESB developer

Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
In reply to this post by OpenESB Community Forum mailing list
Hi Jeanne,

I did reply via email, but it appears not to have made it to the forum - so
here it is (with an additional thought)

Hi,

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?

While I was looking at this issue I used the fileBC to attempt to capture
what was happening - this happily saved the string component only, thus
adding to my confusion.

                Dave.




--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list


Hello Dave,
We fully agree with you that it works well on file BC we had the same thoughts you had at PYMMA when you applied your issue.
For the moment, if you look at the community code, text/plain is not supported on the rest BC. PYMMA team is trying to see how to improve the Community Code to solve this problem.
Best regards,
 
Jeanne ROMEFORT,
OpenESB Developer


-----Original Message-----
From: Dave Woodman via User <[hidden email]>
To: user <[hidden email]>
CC: Dave Woodman <[hidden email]>
Sent: Fri, 13 Jul 2018 13:18
Subject: Re: [User] RESTBC - unexpected XML header when using text/plain

Hi Jeanne,

I did reply via email, but it appears not to have made it to the forum - so
here it is (with an additional thought)

Hi,

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?

While I was looking at this issue I used the fileBC to attempt to capture
what was happening - this happily saved the string component only, thus
adding to my confusion.

Dave.




--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: RESTBC - unexpected XML header when using text/plain

OpenESB Community Forum mailing list
Thank you!

Feel free to ask me to test anything you come up with - I am already running
sources from Bitbucket so patches would be OK...

Dave.



--
Sent from: http://openesb-community-forum.794670.n2.nabble.com/