By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,068 Members | 1,734 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,068 IT Pros & Developers. It's quick & easy.

MSMQ Send Problem in ASP.NET

P: n/a
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.
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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.

Jul 21 '05 #2

P: n/a
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.


Jul 21 '05 #3

P: n/a
It appears that either
mq.DefaultPropertiesToSend.HashAlgorithm = HashAlgorithm.None
or
mq.DefaultPropertiesToSend.EncryptionAlgorithm = EncryptionAlgorithm.None
are not allowed in ASP.NET. Commenting these two lines out allowed the
application to work.

Thanks for the help.

Pete Loveall
Jul 21 '05 #4

P: n/a
Hi Pete,
Actually the problem was mq.DefaultPropertiesToSend.EncryptionAlgorithm =
EncryptionAlgorithm.None . EncryptionAlgorithm can only be set to RC2 or RC4
(I guess the MSDN documentation -
http://msdn.microsoft.com/library/en...asp?frame=true
- is misleading on this point).

In order to tell MSMQ to send plain (unencrypted) messages, one shoud set
UseEncryption to false (or simply leave it as is - this is the default).
EncryptionAlgorithm just sets the algorithm used IF UseEncryption is true.

Are you sure th code worked outside of ASP.NET?

All the best,
Yoel Arnon
www.msmq.biz
"Pete Loveall" <ps*@ametx.com> wrote in message
news:10*************@corp.supernews.com...
It appears that either
mq.DefaultPropertiesToSend.HashAlgorithm = HashAlgorithm.None
or
mq.DefaultPropertiesToSend.EncryptionAlgorithm = EncryptionAlgorithm.None
are not allowed in ASP.NET. Commenting these two lines out allowed the
application to work.

Thanks for the help.

Pete Loveall

Jul 21 '05 #5

P: n/a
Yes, it definitely worked outside of ASP.NET. Must be some extra checking
in the ASP.NET code.

Thanks.

Pete Loveall

"Yoel Arnon" <yo**@msmq.biz> wrote in message
news:Om**************@TK2MSFTNGP12.phx.gbl...

Are you sure th code worked outside of ASP.NET?

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.