473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Send MSMQ message using C# without serialization?

Is there any way to send a Message without having the .NET framework add the
"serialization" data to the body of the message? I am sending binary
structures in the message and I need full control over what is in the body
of the message. I see some extra bytes before and after the message I asked
the system to write. I am looking for a way to get rid of those so I can
send binary structures in messages to a C++ program and vice versa.

I am using the following code to send a message:
---
MessageQueue messageQueue = new MessageQueue(@".\private$\test");
byte[] buffer; // binary structure is in this array
Message message = new Message(buffer, new BinaryMessageFormatter());
messageQueue.Send(message);
Jan 31 '08 #1
1 8705
Well, you can always have the C++ code deserialize the message through
the .NET framework and then access the object serialized on the message.

If you really must control all the bytes on the message, instead of
setting the Body property on the Message, you can set the BodyStream
property to a Stream that will contain the data to be sent.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tbone" <tr****@spam.comwrote in message
news:uY**************@TK2MSFTNGP04.phx.gbl...
Is there any way to send a Message without having the .NET framework add
the "serialization" data to the body of the message? I am sending binary
structures in the message and I need full control over what is in the body
of the message. I see some extra bytes before and after the message I
asked the system to write. I am looking for a way to get rid of those so
I can send binary structures in messages to a C++ program and vice versa.

I am using the following code to send a message:
---
MessageQueue messageQueue = new MessageQueue(@".\private$\test");
byte[] buffer; // binary structure is in this array
Message message = new Message(buffer, new BinaryMessageFormatter());
messageQueue.Send(message);
Jan 31 '08 #2

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

Similar topics

5
by: Pete Loveall | last post by:
I have a server application that monitors a private local queue for messages. The message sent to it has a label and a response queue defined. It works correctly when the queue is accessed via...
1
by: **** KiteOregon **** | last post by:
I need to send & receive XML Document Objects via the Message Queue. We have several applications that insert XML Document Object into the message queue. This works with no problem. I am trying...
0
by: Stefan Näsman | last post by:
Hi When reading XML documents from a MSMQ Queue I get some serialization exception and I don't know how to solve it. Exception message: "Cannot deserialize the message passed as an argument. ...
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...
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...
2
by: SammyBar | last post by:
Hi all, I'm trying to send a message from ASP.NET to another PC by using MSMQ. I created my ASP.NET project by using Visual Studio 2005 but I initially set the project to be located on the File...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
0
by: Buddy Home | last post by:
There is two examples of code. Example 1. Send and Receive within the same process. Put this code in a console app called SendAndReceive and run the code. using System; using...
3
by: plex4r | last post by:
I want to add guaranteed delivery (or at least guarantee sent) to some code using SmtpMail.Send(). The method is void. Does Send() throw exceptions if it cannot connect to the Smtp server or has...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.