Click here to Skip to main content
11,933,905 members (36,766 online)
Rate this:
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 20:59pm
Jameel Moideen 4-Jun-13 2:23am
can you post the rest endpoint?
Jameel Moideen 4-Jun-13 2:26am
also post the code for calling the rest service in console
amitt0488 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.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