473,692 Members | 2,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

InvalidOperatio nException

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.Invalid OperationExcept ion'
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 **
MessageQueueCom munication m = new MessageQueueCom munication("myP ath");
CommunicationUn it cu = new CommunicationUn it(m, "Test");
MessageQueue mq = new MessageQueue(my Path);
mq.Send(cu);
public abstract class ICommunicationT uple
{
public ICommunicationT uple(){}
}

public class MessageQueueCom munication : ICommunicationT uple
{
private string msgQueuePath;
public MessageQueueCom munication(){}

public MessageQueueCom munication(stri ng messageQueuePat h)
{
MessageQueuePat h = messageQueuePat h;
}

public string MessageQueuePat h
{
set { msgQueuePath = value;}
get { return msgQueuePath; }
}
}

public class CommunicationUn it
{
private ICommunicationT uple communicationTu ple;
private string communicationTy pe;

public CommunicationUn it(){}
public CommunicationUn it(ICommunicati onTuple commTuple, string
commType)
{
CommunicationTu ple = commTuple;
CommunicationTy pe = commType;
}

public ICommunicationT uple CommunicationTu ple
{
get { return communicationTu ple; }
set { communicationTu ple = value; }
}

public string CommunicationTy pe
{
set { communicationTy pe = value; }
get { return communicationTy pe; }
}

Dec 5 '05 #1
1 2586
Curious,

By default, the message queue classes use an XmlMessageForma tter 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 BinaryMessageFo rmatter
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 ICommunicationT uple, but
rather, CommunicationTu ple, since it is an abstract class, not an interface.

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

"Curious" <th****@mail.gl obal.net.mt> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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.Invalid OperationExcept ion'
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 **
MessageQueueCom munication m = new MessageQueueCom munication("myP ath");
CommunicationUn it cu = new CommunicationUn it(m, "Test");
MessageQueue mq = new MessageQueue(my Path);
mq.Send(cu);
public abstract class ICommunicationT uple
{
public ICommunicationT uple(){}
}

public class MessageQueueCom munication : ICommunicationT uple
{
private string msgQueuePath;
public MessageQueueCom munication(){}

public MessageQueueCom munication(stri ng messageQueuePat h)
{
MessageQueuePat h = messageQueuePat h;
}

public string MessageQueuePat h
{
set { msgQueuePath = value;}
get { return msgQueuePath; }
}
}

public class CommunicationUn it
{
private ICommunicationT uple communicationTu ple;
private string communicationTy pe;

public CommunicationUn it(){}
public CommunicationUn it(ICommunicati onTuple commTuple, string
commType)
{
CommunicationTu ple = commTuple;
CommunicationTy pe = commType;
}

public ICommunicationT uple CommunicationTu ple
{
get { return communicationTu ple; }
set { communicationTu ple = value; }
}

public string CommunicationTy pe
{
set { communicationTy pe = value; }
get { return communicationTy pe; }
}

Dec 5 '05 #2

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

Similar topics

0
1400
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 a control until the window handle has been created.' ? Also, my VS.net suddenly won't let me trace into button's event handler. It hangs up if I try to trace to the button click event handler.
0
2162
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, using SANS for file storage. It seemed to start once we installed the SSL cert. But, that could be just when we noticed the problem. Any ideas would be greatly appreciated. Thanks <!ljr!>
1
6197
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 few days, the webservice stops responding and the .NET windows app client fails with no informative error message. When I try to run any webmethod from the webservice locally in the browser I first get a "This page cannot be display IE error...
2
4088
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 style="document"/use="literal", everything works fine - the header is added, message is serialized and all is ok. If the Web Service request is for an operation with style="rpc"/use="encoded":
4
10356
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 but no problems there. So, it looks like brushes and pens cannot be used in different threads simultaneously. Looks like a dotnet bug to me. This exception is easily reproducible with the following code, both on single
0
1903
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 Message="Unable to generate a temporary class (result=1).\r\nerror CS0012: The type 'SecureSpeak.Protocol.ssContactItem' is defined in an assembly that is not referenced. You must add a reference to assembly 'SecureSpeak.Protocol, Version=1.0.0.0,...
3
14214
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 transfer file attachments to and from the server. I'm using WSE 2.0 SP3 which is supposed to support FX 2.0, as far as I know. (We will soon move on to MTOM, however I'm stuck with DIME for now; the solution was originally written for FX 1.1, and I...
2
3855
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 Set on the thread and not reverted(undone). It seems to pop up when I use nSoftware's IPDaemon...
2
4298
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, so if I need to elaborate on something please ask for it. We have a UserControl with a WebBrowser on it. This UserControl is instantiated a few times during the program run, depending on user interaction. The WebBrowser then navigates to a local...
4
4341
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 clue WHY the ConnectionString wouldn't be initialized as I do not play with anything near it in my code. my service is running perfectly from last few years, and the same code executed millions of time. I am using VS 2003, .net 1.1. Do you have any...
0
8611
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8546
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9090
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8969
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8810
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6462
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2981
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 we have to send another system
2
2242
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1962
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.