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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with diagram SaveSoap/LoadSoap method...

Thread ID:

Created:

Updated:

Platform:

Replies:

70588 Dec 17,2007 09:28 PM UTC Jan 4,2008 02:45 AM UTC Windows Forms 6
loading
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."
Source="mscorlib"
StackTrace:
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"}
StackTrace:
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 6.1.0.34.
{Installation Drive}\Documents and Settings\{UserName}\My Documents\Syncfusion\EssentialStudio\6.1.0.34\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?

Regards,
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,
Leo


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.

Regards,
Subhasheela R




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

Hi Leo ,

If you have v.4.4.0.46, 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.

http://websamples.syncfusion.com/samples/Diagram.Windows/F70588/main.htm

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.

Regards,
Nagaraj


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.

Thanks,
Leo


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.

Regards,
Nagaraj


CONFIRMATION

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.

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

;