473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MSMQ Send Problem in ASP.NET

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
5 7959
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Gordon | last post by:
I'm investigating getting Microsoft Navision to do stuff from a Python script. The recommended way seems to be to use message queues (MSMQ). I can get Navision to send a message to itself fine. I...
6
by: Ed A | last post by:
Hi all: I'm try to create a private message queue to communicate between my service and any client that wants to display the data. Everything seems ok until I try to send a message to the queue...
4
by: SRLoka | last post by:
I have an application that has five threads. All five threads write to the same MSMQ. All five threads are using the same global instance to send data to the MSMQ server(on same machine)....
1
by: Richard Atkinson | last post by:
I would appreciate help on the Microsoft Message Queue. Basically I would like to Serialize an entire class into a message queue and then reinstantiate the class in another application from the...
5
by: Pete Loveall | last post by:
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...
3
by: Claudia | last post by:
Hi all... I'm working on a project that uses MSMQ as its core for inter-process communication. At the moment there is a single process that listens for inbound TCP-based messages on a socket,...
0
by: yonirabin | last post by:
Hello, I am building a system in C# 2.0 using the master - worker design pattern The system is supposed to work as follows: 1. The Master sends Command objects to the workers 2. All Commands are...
3
by: yonirabin | last post by:
Hello, I am building a system in C# 2.0 using the master - worker design pattern The system is supposed to work as follows: 1. The Master sends Command objects to several workers 2. All Commands...
2
by: SammyBar | last post by:
Hi all, I'm trying to send a message from ASP.NET to another PC by using MSMQ. I created my ASP.NET project by using Visual Studio 2005 but I initially set the project to be located on the File...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.