0
MSMQ에서 오는 json 메시지를 deseriliaze하려고하지만 구문 분석 중에 예외가 발생합니다.메시지 큐에서받은 메시지 역 직렬화
내가 같이 일을 오전 :
var transaction = new MessageQueueTransaction();
transaction.Begin();
Console.WriteLine("Listening For Message Now...");
var message = queue.Receive(transaction);
var reader = new StreamReader(message.BodyStream,Encoding.Default);
var jsonMessage = reader.ReadToEnd();
var emailMessage = JsonConvert.DeserializeObject<MessageType>(jsonMessage);
The Exception:
................
Json Parser Exception Unexpected character encountered while parsing value: S. Path '', line 0, position 0
The Message Coming from MSMQ with control characters:
.................................
내가이 expection가 구문 분석하는 동안 오는 일반적인 expection 생각합니다.
대기열에서 메시지를 수신하는 올바른 방법은 무엇입니까?
어떤 의미 예 :
은 무엇 예외 : 다음
는이 같은 메시지를 읽을? 또한'formattedString'은 무엇입니까? –
expection을 추가했습니다. formattedstring 변수에 할당 된 일부 제어 문자를 제거하려고했습니다. 죄송합니다. 원래 코드를 붙여 넣었어야합니다. – Bravo11
'JSONMessage'에 실제로 JSON이 포함되어 있는지 궁금합니다. (msmq에 익숙하지 않습니다.) - any 'jsonMessage' (또는 어쨌든 그것의 첫번째 부분)의 내용을 게시 할 수있는 기회가 있습니까? –