send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
Go Back  Xtreme Visual Basic Talk > > > send and retrieving a xml via MSMQ


Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2010, 03:39 AM
michelleqw michelleqw is offline
Junior Contributor
 
Join Date: Jun 2005
Posts: 212
Default send and retrieving a xml via MSMQ


Dear all,

We are trying to get a xml file from and to MS message queuing. We searched on the internet but we didn't find any code.

We found code to read and write binary data (.jpg) with MSMQ and everything is working fine but if we are using for this code for a xml file it gives memory? problems.

Can someone help us to find script for xml files?

Nice regards,
Michelle.
Reply With Quote
  #2  
Old 06-17-2010, 05:13 AM
PlausiblyDamp's Avatar
PlausiblyDampsend and retrieving a xml via MSMQ PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Any chance you could show the code you are using to send XML? It is far easier for people to help when they have something to look at.

When you say
Quote:
it gives memory? problems
could you be a little more specific; does it leak memory? Does it throw an exception or is something else happening?
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 06-17-2010, 06:52 AM
michelleqw michelleqw is offline
Junior Contributor
 
Join Date: Jun 2005
Posts: 212
Default

Hello PlausiblyDamp,

We don't understand the message, but when we use the code for reading the binairy info for a string it gives this error, see attachment. (sorry it's Dutch)

We do believe you can only place a string in the MQ, for example a xml, after reading the MQ you have to save it to a xml file.

Maybe you (all) have better idea's?

code for sending to MQ

Sub toQueue()
Try

'Proberen()
Dim strque As String
strque = ".\private$\test"

Dim oQueue As New MessageQueue(strque)
oQueue.Send("This a xml message", "test.xml")

MessageBox.Show("Done")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Attached Images
File Type: jpg MQ.jpg (23.6 KB, 5 views)
Reply With Quote
  #4  
Old 06-17-2010, 07:22 AM
PlausiblyDamp's Avatar
PlausiblyDampsend and retrieving a xml via MSMQ PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Try setting the formatter of the queue to be an xml formatter (check msdn for XmlMessageFormatter) on both ends before sending and receiving the message - that might solve the problem.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #5  
Old 06-17-2010, 08:37 AM
michelleqw michelleqw is offline
Junior Contributor
 
Join Date: Jun 2005
Posts: 212
Default

Hello PlausiblyDamp,

This is the code we are using, but isn't possible to change it with XmlMessageFormatter

Hope you can help us.

Michelle.


Private Sub ReceiveMessage(ByVal MQin As String, ByVal dirOutput As String)
'**************************************************
' Receives a message containing an image.
'**************************************************
Dim N As Long
Try
For N = 1 To countMSMQ(MQ_test_in)
' Connect to the a queue on the local computer.
Dim MessageQueue2 As New MessageQueue(MQin)

' Set the formatter to indicate body contains an Order.
MessageQueue2.Formatter = New BinaryMessageFormatter()

Dim myMessage As System.Messaging.Message = MessageQueue2.Receive()
Dim myImage As Bitmap = CType(myMessage.Body, Bitmap)
' MsgBox(myMessage.Label)

' This will be saved in the \bin\debug or \bin\retail folder.
myImage.Save(dirOutput & myMessage.Label, System.Drawing.Imaging.ImageFormat.Bmp)

Next

vulForm()

Catch ex As Exception
MsgBox("ReceiveMessage: " & Err.Description)
End Try

Return
End Sub 'ReceiveMessage
Reply With Quote
  #6  
Old 06-17-2010, 09:31 AM
PlausiblyDamp's Avatar
PlausiblyDampsend and retrieving a xml via MSMQ PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

When you try to send and receive using xml what formatter are you using? Are you sending well formed xml or are there errors in your document?

You do realise in your first post you are just sending the string "test.xml" and not the contents of the xml file itself don't you?

Also if you could use the code tags when posting code it makes it much easier to read when you do.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
 
send and retrieving a xml via MSMQ
send and retrieving a xml via MSMQ
 
-->