VB and XML Encoding (UTF-8) to MSMQ :Integration to Navision 5.0 SP1

Guys…I really need your help… I have this vb code where i will send a value typed in a textbox to MSMQ…and NAS is successfully started with startup parameter ‘WEBSERVICE’ and the test c/al code susccessfully run within Navision in Codeunit 1 (trigger 99)…it’s just that the integration part is failed…











//synic.Alamat := ‘kg baru’;

//synic.Fon := ‘9876655’;

//synic.Rumah := ‘banglo’;



CC2::MessageReceived(VAR InMessage : Automation “’’.IDISPATCH”)

// get the message

InMsg := InMessage;

InS := InMsg.GetStream();

// load the message into an XML document and find a node

XMLDom.load (InS);

XMLNode := XMLDom.selectSingleNode (‘string’);

// open the response queue and create a new message


OutMsg := CC2.CreateoutMessage(‘Message queue://.\fromNavision’);

OutS := OutMsg.GetStream();

// build the contents of your message

XMLNode.text := UPPERCASE (XMLNode.text);

// fill the message and send it




Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim mq As MessageQueue

'Dim format As XmlMessageFormatter

Dim msg As Message

'Dim dec As XmlDeclaration


msg = New Message

msg.Priority = MessagePriority.Normal

If Not (MessageQueue.Exists(".\Private$\toNavision")) Then

mq = MessageQueue.Create(".\Private$\toNavision")


mq = New MessageQueue(".\Private$\toNavision")

End If

msg.Label = “Navision MSMQ-BA”

msg.Body = TextBox1.Text


Label1.Text = “Message sent.”

Catch ex As MessageQueueException

Label1.Text = ("MSMQ Error: " + ex.ToString())

Catch ex As Exception

Label2.Text = ("Error: " + ex.ToString())



End Try

End Sub

And the result is successful…where by I can see the message in the queue…

but i’m not sure of the XML encoding…and i need to send the message in UTF-8, furthermore i can’t figure out how to send those message to be UTF-8 into the Queue… Please help…

Your message queue must be private and non-transactional. The message queue’s AD integration must be turned off. Also, I believe someone posted that the MQBA doesn’t work on 64 bit.

By the way, pasar malam means busy evening right? I used to live in Holland and they had this market every year called ‘pasar malam besar’ and some told me that means busy evening market. The only other thing I remember is selamat makan and trima kasi, but I probably spelled that wrong :).

In your VB Code use MSDOM DLL file and load
msg.Body = MSDOM;
In Textbox1.Text You need to include the following in your xml tag.
? xml version=“1.0” encoding=“utf-8” ?
XMDOM will then encodde it in UTF-8

Guys…I’m very new to Navision and never done any system integration…my knowledge currently is limited…so bear with me if i ask more questions…i take this as a challenge to myself n see how far i can go actually

DenSter, u r right about the ‘pasar malam’ [:D]…glad to hear that u at least remember the country…

my queue is private and non-transactional and the queue is not published to AD…everything are running on my local…n my machine is 32 bit…

Rashed Amini

i dont quite understand the code…but i’ll try to find out about it…thanks [:D]