tags:

views:

139

answers:

1

Hi,

Iam new to .Net and working on MSMQ

I want to check whether the body of a message receives is valid or not , so I am doing a validation " msmqMessage.Body == null " , but this throws exception . I also found that the bodytype is 0 when this happens other wise it will be 768

So is it ok to check whether the bodytype ==0 for invalid message .

I dont know what does 0 and 768 stands for , from where i can get differnt values for bodytype and what does it represent?

A: 

I suspect you set 'BodyType' yourself (from the other side).

What constitutes 'valid' for you? Is it that the object is of a specific type? perhaps check for that.

Who else is writing objects to your queue, and what type are they?

Noon Silk
Explicitly I didnt set the bodytype any where , formatter set to BinaryMessageFormatter , then send the message .Is it mandatory to set the bodytype ?It will be helpful if you could help me to find the definition of '0' ,768 and other numerical values if any
somaraj
I never set the BodyType, but I also never check it. I am also using a BinaryMessageFormatter. My other question remains - who else sends messages into your queue?
Noon Silk
Did anyone manage to figure this out? I have the same problem - messages with BodyType=0 are breaking my program
Dmitri Nesteruk