473,395 Members | 1,441 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,395 software developers and data experts.

Using MSMQ on Windows (and Navision)

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 found a couple
of code example in an ancient message in this newsgroup. The send.py
one I changed to the following:

from win32com.client import gencache
msmq = gencache.EnsureModule('{D7D6E071-DCCD-11D0-AA4B-0060970DEBAE}',
0, 1, 0)
qi = msmq.MSMQQueueInfo()
qi.PathName = ".\\testqueue"
try:
myq = qi.Open(msmq.constants.MQ_SEND_ACCESS,0)
except:
qi.Create()
myq = qi.Open(msmq.constants.MQ_SEND_ACCESS,0)

if myq.IsOpen:
msg = msmq.MSMQMessage()
msg.Priority = 3
msg.Body = "Hello World!"
msg.Label = "Navision MSMQ-BA"
print len(msg.Body)
print msg.BodyLength

msg.Send(myq)
myq.Close()

--------------------

And the read one all I changed was the queue name.

# read.py - reads from the queue

# following bit generated via "makepy -i" ...
# Use these commands in Python code to auto generate .py support
from win32com.client import gencache
msmq = gencache.EnsureModule('{D7D6E071-DCCD-11D0-AA4B-0060970DEBAE}',
0, 1, 0)

qi = msmq.MSMQQueueInfo()
qi.PathName = ".\PyQueueX"
myq = qi.Open(msmq.constants.MQ_RECEIVE_ACCESS,0)
if myq.IsOpen:
msg = myq.Receive()
print " body: %s" % msg.Body
print "label: %s" % msg.Label
myq.Close()

---------------------

They can send messages to each other fine.

The read.py can receive messages from Navision fine.

But messages sent to Navision (after changing the msg.Label to "Navision
MSMQ-BA") show up as empty messages (nothing in the body).

I can only see two differences between messages generated from Navision
and messages generated send.py.

1) Messages from Navision have something in the "Administration" bit
when you look at the message's properties in computer management (Format
name: PUBLIC=2bc802b2-7778-42c1-bc30-28caca20d974, Name:
it2-new\nsadminreceivequeue). Where as ones from send.py don't.

2) Every character in the body of messages sent from send.py has a 0
value character after them (ie in hex 48 00 65 00 6C 00 6C 00 6F 00 20
00 57 00 00 6F 00 72 00 6C 00 64 00 21 00)

Adding a print msg.BodyLength just before the msg.Send(myq) yields 24
for a 12 character message.

I'm assuming it is 2), coz it's just weird (unicode?).

Any ideas?
Jul 19 '05 #1
0 3644

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Steve | last post by:
Hello I have just been given a new project requiring that I create a new web application in Microsoft .NET that integrates with Navision Axapta v 3.0 While I am aware that I would be able to...
8
by: SunshineGirl | last post by:
I'm trying to trigger an app with the following code from a message queue. It works with only the message box voilą! enabled. But it causes the exception below when it is triggered with the rest of...
0
by: Rudy | last post by:
I'm testing MSMQ 3.0 via HTTP. Our network configuration is as follows: A. Windows 2003 Server Edition in Site1 Queue messages are sent from here. B. Windows 2003 Web Edition in Site2 This...
14
by: Webbee | last post by:
I have a service built that is trying to read messages from a private que. When this tries to happen I get this error.... A workgroup installation computer does not support the operation From...
3
by: kd | last post by:
Hi All, I am working on Windows XP. I guess, Microsoft Message Queuing is not installed by default. Can anybody give me a link from where I can download the same? Thanks. kd
2
by: kd | last post by:
Hi All, Can Windows message queues be used to communicate between 2 applications running on the same computer? I am not sure whether this is possible, if it is possible how can this be compared...
11
by: Jon Davis | last post by:
Can a solution built in C# utilize MSMQ and/or MTS? If so, does this make the training material I already have on MSMQ and MTS in the context of VB6 an appropriate prerequisite foundation before...
1
by: Florence Tissot | last post by:
We are seeing some kind of resource leak in our performance lab running an ASP.NET (2.0) application that sends and receives messages from 2 public MSMQ queues. Here's a brief summary of what are...
1
by: lmod | last post by:
I am developing an application using WPF and WCF. This app on the server side will need for WCF services hosted in IIS6 to communicate with WCF services that are hosted as Windows services on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.