Creating a .Net 3.5 assembly that is making a call to PHP server. Return value a JSON object. The JSON object has a Base64 encoded WAV file (see below). Trying to use Newtonsoft.Json to get the WAV converted from "value". Spent 8 hours trying...
here is the code I have tried
int count = 0;
byte[] buf = new byte[8192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();
count = resStream.Read(buf, 0, buf.Length);
string json = Encoding.ASCII.GetString(buf, 0, count);
JObject jo = JObject.Parse(json);
//JObject jo = (JObject)JsonConvert.DeserializeObject(json);
This is where I get stuck. Error reads:
"Unterminated string. Expected delimiter: \". Path 'result.value', line 1, position 3449."
Almost like the string is too long...
Have not even gotten to the Base64 convert code I sourced off the internet that needs to be tweaked
char[] base64CharArray;
inFile = new System.IO.StreamReader(inputFileName,System.Text.Encoding.ASCII);
base64CharArray = new char[inFile.BaseStream.Length];
inFile.Read(base64CharArray, 0, (int)inFile.BaseStream.Length);
base64String = new string(base64CharArray);
Solution is to go live first thing Monday...