Communication Component and integration without
 
            
                
                    Styvie                
                
                    Member Posts: 77                
            
                        
            
                    Hi,
I am trying to integrate some web server process into Navision using MSMQ and trying to use ComCom2 to do it.
The problem I am having is that VBScript uses Unicode strings (with 00 hex) every second character. Hence Instream.READ or InStream.READTEXT break and assume InStream.EOS is true, despite more characters being in the Message.
I have tried to use ComCom2 on the WebServer , but cannot get the webserver to create instances on ComCom2 , either the Communication Component, or the MSQBusAdapter.
I have even tried to copy the Visual basic example in Navision but only have Visual Studio .NET.
The following code is as close as I can get it,
Dim cc2
Dim mqBA
Dim outMsg
Dim Dom
Dim inMsg
Dim ResponseText
cc2 = New NSCOMCOM2Lib.CommunicationComponent()
mqBA = New MSMQBUSADAPTERLib.MSMQBusAdapter()
Dom = New MSXML2.DOMDocument30()
cc2.AddBusAdapter(mqBA, 1)
mqBA.OpenWriteQueue(".\private$\toNavision", 0, 0)
mqBA.OpenReplyQueue(".\private$\ReplyQueue", 0, 0)
outMsg = cc2.CreateoutMessage("Message queue://")
Dom.Load("C:\test.xml")
Dom.Save(outMsg.GetStream())
inMsg = outMsg.SendforWaitReply(5000)
If inMsg Is Nothing Then
Debug.Write("No Response")
Else
Dom.Load(inMsg.GetStream)
Dom.Save(ResponseText)
Debug.Write(ResponseText)
End If
THis code breaks on the line : Dom.Save(outMsg.GetStream())
saying : Member not Found.
I have check the OutMsg object in object browser and that method does exist.
I am at a wits end with this....
If i could somehow send a non-unicode string to the MSMQ from the website, it would solve all my problems, but VBScript seems to only be able to send Unicode strings.
Has anyone got any idea's I can try.
NB. THe webserver is running Windows 2000 (No .NET framework) - so I cannot even use the C# example on MSDN.
THanks.
                I am trying to integrate some web server process into Navision using MSMQ and trying to use ComCom2 to do it.
The problem I am having is that VBScript uses Unicode strings (with 00 hex) every second character. Hence Instream.READ or InStream.READTEXT break and assume InStream.EOS is true, despite more characters being in the Message.
I have tried to use ComCom2 on the WebServer , but cannot get the webserver to create instances on ComCom2 , either the Communication Component, or the MSQBusAdapter.
I have even tried to copy the Visual basic example in Navision but only have Visual Studio .NET.
The following code is as close as I can get it,
Dim cc2
Dim mqBA
Dim outMsg
Dim Dom
Dim inMsg
Dim ResponseText
cc2 = New NSCOMCOM2Lib.CommunicationComponent()
mqBA = New MSMQBUSADAPTERLib.MSMQBusAdapter()
Dom = New MSXML2.DOMDocument30()
cc2.AddBusAdapter(mqBA, 1)
mqBA.OpenWriteQueue(".\private$\toNavision", 0, 0)
mqBA.OpenReplyQueue(".\private$\ReplyQueue", 0, 0)
outMsg = cc2.CreateoutMessage("Message queue://")
Dom.Load("C:\test.xml")
Dom.Save(outMsg.GetStream())
inMsg = outMsg.SendforWaitReply(5000)
If inMsg Is Nothing Then
Debug.Write("No Response")
Else
Dom.Load(inMsg.GetStream)
Dom.Save(ResponseText)
Debug.Write(ResponseText)
End If
THis code breaks on the line : Dom.Save(outMsg.GetStream())
saying : Member not Found.
I have check the OutMsg object in object browser and that method does exist.
I am at a wits end with this....
If i could somehow send a non-unicode string to the MSMQ from the website, it would solve all my problems, but VBScript seems to only be able to send Unicode strings.
Has anyone got any idea's I can try.
NB. THe webserver is running Windows 2000 (No .NET framework) - so I cannot even use the C# example on MSDN.
THanks.
0                
            Comments
- 
            If you take a look at the "Request Handler"-codeunit in comerce portal you see a usage of another msmq component. This one handles the original message (with the 00 hex every other character) and works fine.0
- 
            The Commerce portal codeunit does not use directly the MSMQ bus adapter but rather a special component (part of the Commerce Server installation) which wraps the MSMQ function and does not return a stream but rather a XML DOM document. A similar approach is used by the Employee Portal. So except for writing a wrapper component is there any other solution to the Unicode MSMQ problem?0
- 
            Only one way to get around that that I know of, and that is to use the Message queing object model directly. I am in a meeting right now, but if you send me a PM to remind me I will post some code in here later this week.0
- 
            Is it possible to use the MSMQ COM components directly and still register for aMessage-Received event?0
- 
            No there is no message received event that I could find. I ended up doing it with a timer that peeks in the queue and picks up the messages if they are there.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


