Author |
Message |
gsbrown

Group memberships: Premium Members
Joined: 23 Sep 2002
Posts: 148
Location: USA
Points: 1977
|
|
DataStage® Release: 9x |
Job Type: Parallel |
OS: Unix |
|
I'm new to REST binding and put together my first test.
The results data-wise I'm getting is fine, but I don't understand why it has the appended \r\n and extra slash characters all throughout the response. Is this normal or what controls that? I've tried both attaching the ISD_Output stage at the receiving end of the XML Stage directly and also tried dumping the JSON output to a sequential file and using the folder stage to ISD_Output. Both do this same behavior.
Code: |
{"result":"[ {\r\n \"label\" : \"Clearance\",\r\n \"path\" : \"/category/Clearance.do\",\r\n \"Children\" : [ {\r\n \"label\" : \"Bracelets\",\r\n ...... |
Any feedback on what causes this and if it can be tweaked somewhere that I'm missing? Thanks!
|
|
|
|
 |
ray.wurlod
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group
Joined: 23 Oct 2002
Posts: 54621
Location: Sydney, Australia
Points: 296179
|
|
|
|
|
|
The double quote characters are being "escaped" so that they are not meaningful to any shell processing the payload and will be interpreted as literal quote characters.
|
_________________ IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold. |
|
|
 |
chulett
 since January 2006
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 12 Nov 2002
Posts: 43085
Location: Denver, CO
Points: 222463
|
|
|
|
|
|
Wasn't worried just about the escaped quotes...
gsbrown wrote: |
I don't understand why it has the appended \r\n and extra slash characters all throughout the response. |
|
_________________ -craig
"You can never have too many knives" -- Logan Nine Fingers
|
|
|
 |
qt_ky

Group memberships: Premium Members
Joined: 03 Aug 2011
Posts: 2897
Location: USA
Points: 21971
|
|
|
|
|
|
I do not think that is normal. I have a few REST & JSON ISD applications running with the ISD Output stage. When I test them via the URL with a web browser, I do not see any escaped characters in the results.
|
_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
|
|
|
 |
gsbrown

Group memberships: Premium Members
Joined: 23 Sep 2002
Posts: 148
Location: USA
Points: 1977
|
|
|
|
|
|
OK, the \ escaping each double quote makes sense. How do I stop it from doing that? Like I mentioned, when I'm testing "FolderStage --> Sequential File" I don't have that in my output, but "FolderStage --> RTI Output Stage" my SoapUI response contains the escape slashes and \r\n new line characters. I guess I don't know what's doing it the RTI Stage, WISD, or my SoapUI or Internet Explorer browser. Curious if anyone has experience encountering this?
|
|
|
|
 |
qt_ky

Group memberships: Premium Members
Joined: 03 Aug 2011
Posts: 2897
Location: USA
Points: 21971
|
|
|
|
|
|
Sounds like the folder stage might be causing it. Try a simpler test job: ISD Input --> Transformer --> ISD Output.
|
_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
|
|
|
 |
gsbrown

Group memberships: Premium Members
Joined: 23 Sep 2002
Posts: 148
Location: USA
Points: 1977
|
|
|
|
|
|
It's definitely something after the folder stage, I just don't know what. I tested with an ereplace() function after my folder stage to strip out \" and they're still there.
|
|
|
|
 |
gsbrown

Group memberships: Premium Members
Joined: 23 Sep 2002
Posts: 148
Location: USA
Points: 1977
|
|
|
|
|
|
qt_ky, curious to know are you using REST or REST 2.0?
I started with REST and wanted to see if REST 2.0 gives me this same issue, but instead I get an error with REST 2.0
Code: |
SRVE0255E: A WebGroup/Virtual Host to handle 172.16.100.6:9080 has not been defined. |
|
|
|
|
 |
gsbrown

Group memberships: Premium Members
Joined: 23 Sep 2002
Posts: 148
Location: USA
Points: 1977
|
|
|
|
|
|
OK figured out a couple things and I believe have this resolved!
Decided to go with REST 2.0 instead of REST for the binding.
Fixed the error I was getting after realizing I need to change a piece of my URL path from "wisd-rest" to "wisd-rest2"
Within the Information Service Application setup at the Operations level, there's a tab "REST 2.0 Settings". There, I discovered a checkbox "Output pass through" basically telling the REST API to return the results "as-is". Sure enough, it doesn't insert the escape characters.
|
|
|
|
 |
ray.wurlod
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group
Joined: 23 Oct 2002
Posts: 54621
Location: Sydney, Australia
Points: 296179
|
|
|
|
|
|
\" is an escaped double quote character. \r\n represents a DOS-style line terminator sequence (carriage return, newline).
|
_________________ IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold. |
|
|
 |
qt_ky

Group memberships: Premium Members
Joined: 03 Aug 2011
Posts: 2897
Location: USA
Points: 21971
|
|
|
|
|
|
I'm on version 11.3.1.2 using REST 2.0. It is a bit cumbersome to have to manually piece together the URL. Glad you discovered the resolution!
|
_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
|
|
|
 |
|