473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

InvalidOperationException

Hi,

I am trying to use the following code to send data over a Message
Queue. The following error is being given:
"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There was an error generating the XML
document."

Can someone help me solve the problem out.
Thanks in Advance

** Code **
MessageQueueCommunication m = new MessageQueueCommunication("myPath");
CommunicationUnit cu = new CommunicationUnit(m, "Test");
MessageQueue mq = new MessageQueue(myPath);
mq.Send(cu);
public abstract class ICommunicationTuple
{
public ICommunicationTuple(){}
}

public class MessageQueueCommunication : ICommunicationTuple
{
private string msgQueuePath;
public MessageQueueCommunication(){}

public MessageQueueCommunication(string messageQueuePath)
{
MessageQueuePath = messageQueuePath;
}

public string MessageQueuePath
{
set { msgQueuePath = value;}
get { return msgQueuePath; }
}
}

public class CommunicationUnit
{
private ICommunicationTuple communicationTuple;
private string communicationType;

public CommunicationUnit(){}
public CommunicationUnit(ICommunicationTuple commTuple, string
commType)
{
CommunicationTuple = commTuple;
CommunicationType = commType;
}

public ICommunicationTuple CommunicationTuple
{
get { return communicationTuple; }
set { communicationTuple = value; }
}

public string CommunicationType
{
set { communicationType = value; }
get { return communicationType; }
}

Dec 5 '05 #1
1 2565
Curious,

By default, the message queue classes use an XmlMessageFormatter to
serialize information into the queue (God knows why).

If you have a .NET application listening on the other end, then I would
recommend setting the Formatter property to the BinaryMessageFormatter
class. This will mean that your classes have to be marked as serializable,
but I think you will get better performance as well.

Also, your abstract class should not be named ICommunicationTuple, but
rather, CommunicationTuple, since it is an abstract class, not an interface.

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

"Curious" <th****@mail.global.net.mt> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,

I am trying to use the following code to send data over a Message
Queue. The following error is being given:
"An unhandled exception of type 'System.InvalidOperationException'
occurred in system.xml.dll

Additional information: There was an error generating the XML
document."

Can someone help me solve the problem out.
Thanks in Advance

** Code **
MessageQueueCommunication m = new MessageQueueCommunication("myPath");
CommunicationUnit cu = new CommunicationUnit(m, "Test");
MessageQueue mq = new MessageQueue(myPath);
mq.Send(cu);
public abstract class ICommunicationTuple
{
public ICommunicationTuple(){}
}

public class MessageQueueCommunication : ICommunicationTuple
{
private string msgQueuePath;
public MessageQueueCommunication(){}

public MessageQueueCommunication(string messageQueuePath)
{
MessageQueuePath = messageQueuePath;
}

public string MessageQueuePath
{
set { msgQueuePath = value;}
get { return msgQueuePath; }
}
}

public class CommunicationUnit
{
private ICommunicationTuple communicationTuple;
private string communicationType;

public CommunicationUnit(){}
public CommunicationUnit(ICommunicationTuple commTuple, string
commType)
{
CommunicationTuple = commTuple;
CommunicationType = commType;
}

public ICommunicationTuple CommunicationTuple
{
get { return communicationTuple; }
set { communicationTuple = value; }
}

public string CommunicationType
{
set { communicationType = value; }
get { return communicationType; }
}

Dec 5 '05 #2

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

Similar topics

0
by: Chi Tang | last post by:
Hi, Why when I close all document windows on my Visual Studio.NET a 'Microsoft Development Environment' dialog box shows up with 'InvalidOperationException: Cannot call Invoke or InvokeAsync on...
0
by: LJ | last post by:
I have been getting this message and can't resolve the problem. I have checked the AntiVirus software and added the application directory to the exculsion list. The application is on a web farm,...
1
by: Trygve Lorentzen | last post by:
Hi, my webservice is running on Win2000 SP4, IIS 5.0 fully patched, connecting to a MySQL database and mainly returning Typed DataSet's from webmethods. After running for a while, generally a...
2
by: Mike Fiedler | last post by:
On a client web services request, I have a SoapExtension that is adding a header to the message in the BeforeSerialize stage. If the Web Service request is for an operation with...
4
by: Jos Lavrijsen | last post by:
When i try to re-use brushes or pens over multiple threads, i often get an InvalidOperationException with the message 'object is currently in use elsewhere'. I also tried this by re-using fonts...
0
by: banduraj | last post by:
I get an System.InvalidOperationException when trying to Serialize a struct that has a type refrenced from another library. The exception is: System.InvalidOperationException was unhandled...
3
by: Joseph Geretz | last post by:
System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. My environment: Visual Studio 2005, targeting FX 2.0; I've developed a Web Service which uses DIME to...
2
by: Spam Catcher | last post by:
Anyone know what this error means? The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was...
2
by: Jeroen | last post by:
We are experiencing a tuff-to-debug problem ever since we introduced a WebBrowser control into our failry large application. I'm not sure if the problem description below contains enough details,...
4
by: QC | last post by:
Hi, this morning found that my Service had crashed, and the error was "Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized". I have no...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.