Click here to Skip to main content
11,639,593 members (62,000 online)
Rate this: bad
Please Sign up or sign in to vote.
I have a created a webService, whose output string (in JSON) is given below :

"[{\"CALC_ALTITUDE\":213,\u000a\"ZA_MAINS_SUPPLY\":\"3~ 400V 50Hz\"}]"

When i set this string in a TextBox, the output comes like this :

"ZA_MAINS_SUPPLY":"3~ 400V 50Hz"

And this is a proper JSON text.

But, when i access this using REST Console, the output appears like :

"[{\"CALC_ALTITUDE\":213,\u000a\"ZA_MAINS_SUPPLY\":\"3~ 400V 50Hz\"}]"

My problem is that, TextBox is interpreting this text very well, by reading newline characters and escape sequence \". But, REST Console is not able to do so.

Any idea how to show this text in the same way as this
"ZA_MAINS_SUPPLY":"3~ 400V 50Hz"

in REST console as well ??

Posted 3-Jun-13 19:59pm
Jameel Moideen at 4-Jun-13 2:23am
can you post the rest endpoint?
Jameel Moideen at 4-Jun-13 2:26am
also post the code for calling the rest service in console
amitt0488 at 4-Jun-13 2:54am
[DllImport("FANselect.dll", CallingConvention = CallingConvention.StdCall,
EntryPoint = "ZAJsonRequestA", ExactSpelling = false)]
private static extern IntPtr ZAJsonRequestA([MarshalAs(UnmanagedType.LPStr)]StringBuilder szReq);

public string getZAJsonRequestA(string input)
StringBuilder sbuilder = new StringBuilder();
var variable = ZAJsonRequestA(sbuilder);
string sResult = Marshal.PtrToStringAnsi(variable);
string op = sResult.Trim();

return op;

Here the output is coming from a DLL and getZAJsonRequestA(input) is called using a url which interacts with the DLL & gives the output in string form.

This output is shown in REST Console.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Suvendu Shekhar Giri 330
1 Sergey Alexandrovich Kryukov 244
2 CPallini 177
3 F-ES Sitecore 170
4 himanshu agarwal 167
0 OriginalGriff 9,081
1 Sergey Alexandrovich Kryukov 8,812
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,650
4 F-ES Sitecore 2,548

Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 4 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100