Hi Guys,
I'm new to the forum and I really need your help!!!
I'm stuck with a little application that I was writing to send and receive messages from my windows mobile 6.1 phone to my desktop computer....
I have been successfull to send messages from the phone to a private remote queue on my desktop (this is using wifi connection) but I can't receive it the message from the same queue!!!!
I get an error saying I don't have privileges to read the Queue... but I have set in the security tab of the Queue Full Control to ANONYMOUS USER!!!
So why it doens't work??? Please help!!!
This is the code that I'm using at the moment:
private void SendToPrivateQueueDetails()
{
//Machine Namestring destination = "pippo";
MessageQueue
orderQueue = new MessageQueue(String.Format(System.Globalization.CultureInfo.InvariantCulture,@"FORMATNAME:DIRECT=OS:{0}\private$\myqueue", destination));orderQueue.Formatter =
new XmlMessageFormatter(new Type[] { typeof(String) }); try{
//Sending the Message Works
orderQueue.Send(txtSendMsg.Text,
String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "pippo-label"));txtSendMsg.Text =
""; if (orderQueue.CanRead){
MessageBox.Show("You CAN REad");}
else//It Always enters here!!!
MessageBox.Show("You CANNOT READ!!!"); if (orderQueue.CanWrite){
MessageBox.Show("You CAN WRITE");}
else MessageBox.Show("You CANNOT WRITE!!!");//This return the ERROR!
Message messageReceived = orderQueue.Receive(new TimeSpan(0, 0, 10));
messageReceived.Formatter = new XmlMessageFormatter(new Type[] { typeof(String) });
lblReceiveMsg.Text = (string)messageReceived.Body;
//
}
catch (Exception err){
MessageBox.Show(err.Message);}
}
John BreakwellPosted Feb 25, 2009, 12:56 PM
I knew that problem sounded familiar...
Digging in my archives, I found a link to an old (2000) technical article talking about Windows CE 3.0:
Looking for something newer,
Messages cannot be read from a queue that resides on a computer without a direct connection. Opening a queue with receive or peek access requires a direct connection to the computer where the queue resides.
TaddeoPosted Feb 25, 2009, 3:55 PM
That's Great!
Thanks for having looked into it!
Cheers
TaddeoPosted Feb 25, 2009, 11:37 AM
Hi John,
Thanks for your reply, my test machine is a Win XP Pro SP3 and I did already opened the ports and added the key on the registry but I didn't work.... :(
I've posted my question in another forum and the answer has been that what I am trying to do is not possible? and I can't receive a message on a remote queue with my mobile but I can only send messages...
Is that true?
Many Thanks Again!
Taddeo
John BreakwellPosted Feb 25, 2009, 11:26 AM
Hi Taddeo,
Could you please explain what O/S is on the desktop machine? Windows 2003 and above are not wide open for remotely receiving messages.
You may need to add "NewRemoteReadServerAllowNoneSecurityClient" to the registry
(http://blogs.msdn.com/johnbreakwell/archive/2007/01/15/msmq-3-0-too-secure-for-you.aspx)
or open up RPC ports in the firewall
(http://blogs.msdn.com/johnbreakwell/archive/2008/07/10/getting-msmq-messages-out-of-windows-server-2008.aspx).
Cheers
John Breakwell (MSFT)