The basic code is:
Dim mq As MessageQueue = New MessageQueue(".\Private$\myQueue")
mq.DefaultPropertiesToSend.HashAlgorithm = HashAlgorithm.None
mq.DefaultPropertiesToSend.EncryptionAlgorithm = EncryptionAlgorithm.None
If Not MessageQueue.Exists(".\Private$\" & Session.SessionID) Then
MessageQueue.Create(".\Private$\" & Session.SessionID)
Dim respq As MessageQueue = New MessageQueue(".\Private$\" &
Session.SessionID)
respq.MessageReadPropertyFilter.AdministrationQueu e = False
respq.MessageReadPropertyFilter.ArrivedTime = False
respq.MessageReadPropertyFilter.Body = False
respq.MessageReadPropertyFilter.CorrelationId = False
respq.MessageReadPropertyFilter.Id = False
respq.MessageReadPropertyFilter.Label = True
respq.MessageReadPropertyFilter.ResponseQueue = False
respq.MessageReadPropertyFilter.SentTime = False
mq.DefaultPropertiesToSend.ResponseQueue = respq
mq.Send(Nothing, "Label Text")
Dim msg As Message = respq.Receive()
I am using only the message label to exchange information. I have also
tried mq.Send("Msg Text") to try using the message body but I get the same
error. It is the Send that is failing. This is the full error message and
stack trace:
Exception Details: System.Messaging.MessageQueueException: One or more of
the passed properties are invalid.
[MessageQueueException (0x80004005): One or more of the passed properties
are invalid.]
System.Messaging.MessageQueue.SendInternal(Object obj,
MessageQueueTransaction internalTransaction, MessageQueueTransactionType
transactionType) +415
System.Messaging.MessageQueue.Send(Object obj, String label,
MessageQueueTransaction transaction, MessageQueueTransactionType
transactionType) +164
System.Messaging.MessageQueue.Send(Object obj, String label) +13
myWeb.testpage.Page_Load(Object sender, EventArgs e) in C:\Hidden for
security reasons\testpage.aspx.vb:77
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
"Everyone" does have send capabilities on that queue.
Pete Loveall
"Yoel Arnon" <yo**@msmq.biz> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Hi Pete,
Can you post the piece of code that fails on ASP.NET? It may be a security
problem with the queue, with Active Directory (depending how you set the
target / response queue) or an unrelated problem. the code would help
here...
All the best,
Yoel Arnon
www.msmq.biz
"Pete Loveall" <ps*@ametx.com.NO_SPAM> wrote in message
news:uN*************@TK2MSFTNGP14.phx.gbl...I have a server application that monitors a private local queue for
messages. The message sent to it has a label and a response queue
defined. It works correctly when the queue is accessed via another
program.
However, when I attempt to Send a message from an ASP.NET VB page, I get
"One or more of the passed properties are invalid." I have tried
different combinations of the non-transactional Send() with no success.
My Windows\Temp directory has open access (did this based on another
posted response which took care of the xml formatter loading a temporary
dll) but I cannot get past this message.
If this is a security issue, I need to know how to allow this page send
access as this page must be available to all (no login). It appears that
the queue currently has send access for anonymous login according to the
MSMQ console.
I am posting this on two groups as I do not know which area this really
falls into.
Thanks in advance.
Pete Loveall
AME Corp.