BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in WSCF/WCF

 
 
Page 6621 of 20233

MSMQ Label Property and WCF

Blogger : Stephen Kaufmans WebLog
All posts : All posts by Stephen Kaufmans WebLog
Category : WSCF/WCF
Blogged date : 2007 Dec 18

The label property of an MSMQ message has been used for many things.  Developers still use the label property and want to continue to use it.  So, how do you get access to this property in WCF before posting your message to the queue. 

It turns out that if you are using the NetMSMQBinding you can't.  After thinking about this a bit it makes sense since the NetMSMQBinding only uses MSMQ as an transport mechanism between two endpoints.  In this case any data you want to send between these two endpoints needs to be in the message body.  This is so your endpoints can be agnostic to the underlying transport and allow you to swap it out without having to modify your code.

To be able to utilize the label property you need to use the MsmqIntegrationBinding.  The MsmqIntegrationBinding class enables WCF to use the types defined in the System.Messaging namespace.  The label property is on the MsmqIntegrationMessageProperty class which can be used as follows:

MsmqIntegrationMessageProperty property = MsmqIntegrationMessageProperty.Get(message);

string lbl = property.Label


Read comments or post a reply to : MSMQ Label Property and WCF
Page 6621 of 20233

Newest posts
 

    Email TopXML