ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » insert message to queue using .NET library

Post new topic  Reply to topic
 insert message to queue using .NET library « View previous topic :: View next topic » 
Author Message
al000y
PostPosted: Thu Jan 09, 2014 12:59 am    Post subject: insert message to queue using .NET library Reply with quote

Apprentice

Joined: 25 Dec 2013
Posts: 30

Hi

I am able to insert a message to the queue, but the problem is that i want it to be inserted as XML format not regular string message.

Can anyone till me how
Code:

Dim message As String = "<?xml version=""1.0""?><request><CUST_NO>" + dr.Item("CUSTOMER_NO") + "</CUST_NO><MOB>" + dr.Item("MOBILE_NO") + "</MOB></request>"
mqMsg = mqSession.AccessMessage()
mqMsg.WriteString(message)
mqMsg.Format = MQFMT_STRING
mqPutMsgOpts = mqSession.AccessPutMessageOptions()

Try
     mqQueue.Put(mqMsg, mqPutMsgOpts)
     MsgBox("Message put to queue")
Catch mqe As IBM.WMQ.MQException
     '* report the error
     MsgBox("MQQueue::Put ended with " + mqe.Message())
End Try


With this code when i debug the message in the websphere studio i got a regular string message not XML.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jan 09, 2014 1:43 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

MQ is data format agnostic. In other words the format of the data inside the message does not matter to MQ at all. It is regarded as a payload.

It is the READER app that would parse the messages as XML. If that can be done then you are good to go.

Try reading the message with a tool such as RFHUTIL. This can display the results in XML format.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » insert message to queue using .NET library
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.