Saturday, February 25, 2012

Message Type and Message Body..............

Hello,

I am having trouble specifying a message body that is valid. I mean for the client to send. If I leave it as null then everything is ok but if I create a memorystream and add a line of text it reports back it did not pass validation. I do not understand this and am not sure what to do. I need to send a message based on a code and text but do not know the format of the body that is allowed. The code I am refering to comes out of HelloWord_CLR because that is what I am formating my sample after. I call it the same way it calls the return message done in ServiceProc. I need to know the message format including body since this does not seem to work. A sample of the call is bellow.

// Create an empty request message

string Msg = "Hello";

MemoryStream body = new MemoryStream(Encoding.ASCII.GetBytes(Msg));

Message request = new Message("Request", body);

Thanks,

Scott Allison...

You set the validation of your Request message to be 'Empty'. Hence Service Broker is making sure that you do not attempt to send a message with a non-empty body. If you want to sent arbitrary bytes, set validation to 'None'. If you want to send XML and have it validated set it to 'Well_Formed_XML' or 'XML with schema validation'.

No comments:

Post a Comment