We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with diagram SaveSoap/LoadSoap method...

Thread ID:





70588 Dec 17,2007 09:28 PM UTC Jan 4,2008 02:45 AM UTC WinForms 6
Tags: Diagram
Administrator [Syncfusion]
Asked On December 17, 2007 09:28 PM UTC

Hello there,
I have a problem with diagram SaveSoap / LoadSoap methods. If I'm saving diagram only with symbols then I can load (LoadSoap) this diagram without any problems. As soon as I add connection(s) between the symbols I'm getting Message="Exception has been thrown by the target of an invocation." with Inner Exception: {"Buffer cannot be null.\r\nParameter name: buffer"}. Following is the description and StackTrace of the exception.

Please help. Thanks

System.Reflection.TargetInvocationException was caught
Message="Exception has been thrown by the target of an invocation."
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at Syncfusion.Windows.Forms.Diagram.Controls.Diagram.LoadBinary(Stream strmIn)
at Syncfusion.Windows.Forms.Diagram.Controls.Diagram.LoadBinary(String fileName)
at App.MainForm.menuOpen_Click(Object sender, EventArgs e) in C:\Project\Solution\App\MainForm.cs:line 389

Inner Exception: {"Buffer cannot be null.\r\nParameter name: buffer"}
at System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
at System.IO.MemoryStream..ctor(Byte[] buffer)
at Syncfusion.Windows.Forms.Diagram.MetafileNode..ctor(SerializationInfo info, StreamingContext context)

SubhaSheela R [Syncfusion]
Replied On December 18, 2007 01:47 PM UTC

Hi LR,

Thank you for your posting query to us.

I am afraid that I was not able to reproduce the Exception.
Please refer to the following browser sample in which I have tried to reproduce the Exception with our latest version
{Installation Drive}\Documents and Settings\{UserName}\My Documents\Syncfusion\EssentialStudio\\Windows\Diagram.Windows\Samples\2.0\Quick Start\Serialization\

Kindly have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample or send us reproducing steps so that we could sort out the cause of the issue and provide you a solution? Also, Could you please specify your version, so that we will provide you the exact solution?

Subhasheela R

Administrator [Syncfusion]
Replied On December 18, 2007 04:24 PM UTC

Hi Subhasheela,
I'm running ES v4.4.0.46. I took a part of my project and inserted it into one of your samples and same thing happening. Here's the sequence of events:
1. Start app.
2. Drop my symbol onto the diagram
3. Save the diagram
4. Open the same diagram
5. Save the diagram again
6. Open the diagram and you'll get the error that I mentioned before.
Could you give me your email address and I'll send you the project so you could test it?

Thanks for your help,

SubhaSheela R [Syncfusion]
Replied On December 19, 2007 04:37 AM UTC

Hi Leo,

Thank you for your update.

Could you please send your project to the email : support@syncfusion.com? We will check your project with the reproducing steps given by you and provide you the exact solution.

Subhasheela R

J.Nagarajan [Syncfusion]
Replied On December 19, 2007 09:59 PM UTC

Hi Leo ,

If you have v., the only changes that your custom Symbol type requires is a serialization constructor and an override of the Symbol.GetObjectData(SerializationInfo, StreamingContext) method that implements ISerializable.GetObjectData() for the base Symbol type.

This type of exception occurs because the serialization constructor that your class currently implements is incorrect as for proper serialization the Symbol members have to load from the SerializationInfo parameter; similarly in the GetObjectData() method, the Symbol class has to write it's member contents to the SerializationInfo param.

I have attached a sample that shows the symbol class and a basic Save/Load implementation. The Diagram.SaveSoap/LoadSoap calls that write/read the diagram are invoked in the mainform.cs class.


I hope this helps. Unless please provide us a minimal sample or the diagram file that shows this issue. Please let me know if you have questions.


Administrator [Syncfusion]
Replied On December 28, 2007 07:13 PM UTC

Hello Nagaraj,
I still have the problem with Save/LoadSoap diagram. I sent you email with the modified code (all suggestioned by you changes). Let me know if you got it.


J.Nagarajan [Syncfusion]
Replied On January 4, 2008 02:45 AM UTC

Hi LR ,

On analyzing this issue we were able to find that, the problem is concerned with the symbol palette loaded from an emf file. With the normal diagram symbols in the symbol palette, when serializing/deserialising there is no issues of exception thrown. We need to analyze this issue further and we will be updating you on this.

Thanks for your continued interest in Syncfusion products.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon