Getting an item from the MSMQ Journal, which WCF created
I have a message in a Journal of a Private queue (.\Private$\theQueue\Journal$)
The message was created by WCF and processed (thus on the Journal).
The problem is I want to get the message (the body is too large to view in the Admin Tools) so i have created the following code
MessageQueue myQueue = new MessageQueue(txtQueueName.Text);
Message peekByLookupId = myQueue.PeekById(txtLookUpId.Text);
StreamReader reader = new StreamReader(peekByLookupId.BodyStream);
txtResult.Text = reader.ReadToEnd();
but the StreamReader does not return any result for the ReadToEnd. however the Stream does have a length (peekByLookupId.BodyStream.Length) of 1676
does any one have the code to peek at the XML of the object which WCF created (using the DataContractFormatter)
Or d开发者_StackOverflow社区oes anyone know where is the DataContractFormatter, as i could use this deserialise the object. (I have added the System.Runtime.Serialization to the project and it still does not recognise the object)
Many thanks
In the end I pulled out the body stream as bytes (do not convert into a string). converted into hex and viewed in WinHex..
there has to be a better way
精彩评论