Similar Threads:
1.avoiding XML serialization, different WSDL generation, soap serialization
Hello,
I think my problem is interesting for most of developers who wish to
exchange actual business entities with webservices, not just xml stubs.
I can not use XML serialization, when generating wsdl, because some of
transmited entities have only getters. It is required by our framework and
cannot be avoided (to ensure data consistency in most cases).
How do I exchange business entities in that case? I found several solutions,
basically they all imply serializing my classes with soap/binary formatters
and passing parameters as XmlElements, strings or byte arrays. That implies:
1. versioning problems (but that can be avoided with extra work),
2. anonymous parametes (any serialized object will be passed as
XmlElement, or any other selected transfer type. Type validation will be
performed only during run time, which leads to bugs).
3. using XML serialization either way, just ussing "always XML
serializable" format for parameters.
How else could this problem be addressed? Suggestions are very welcome..
regards,
Ramunas Urbonas
2.serialization, deserialization and serialization again?
In my ws I have a method that serializes a simple custom object with some
properties. On the other side, in my aspx application, the object is
received and deserialized nicely by .net.
But the problem is that i don't _want_ .net to deserialize the returning
xml. The serialized xml text is exactly what I want because Im only going to
feed that string into a simple "Xml Web Control" and then attach a
stylesheet file to it. Im a bit new to this but shouldnt this be very very
simple? At the moment Im doing a work-around and serializing the stupid
object _back_ to xml again and something tells me I shouldnt need to do
that? Since its allready there in the soap response i mean ... but thow do I
get hold of it in aspx .net?
Continuing ...
My first approach was to try and make use of the deserialized object instead
somehow but unfortunately the deserialized object didnt actually have
exactly the same structure as my original object. The properties (get/set)
in my original object had been exchanged for simple variables which then
didnt allow me to use this object as a datasource etc. So that approach left
me with nothing. I really dont get this, why serialize and deserialize if
whats left isnt the same as the original anyway?
3.Serialization and de-serialization of types loaded from assembly at runtime
Hi group!
Is it possible to scan an assembly *which has NOT been added as a
reference* for types, and dynamically create instances of the loaded
types?
I have a program, MyProgram.exe, which at runtime uses
Asseembly.LoadFile(...) to load an assembly, MyAssembly.dll. When
MyAssembly.dll is added as a reference to the MyProgram project,
serialization and de-serialization works lige a charm.
However, when I remove the reference to MyAssembly.dll in the MyProgram
project, I get an exception upon de-serialization.
Is there something I can do which is like "adding an assembly as a
reference at runtime"?
The best,
Mogens
4.Serialization and de-serialization of types loaded from assembly a
Howdy,
Yes it's possible and quite simple. Have a look at my short C# example
private void button3_Click(object sender, System.EventArgs e)
{
System.Reflection.Assembly assembly
=
System.Reflection.Assembly.LoadFile("C:\\WINDOWS\\assembly\\GAC\\Microsoft.VisualBasic\\7.0.5000.0__b03f5f7f11d50a3a\\Microsoft.VisualBasic.dll");
listBox1.BeginUpdate();
foreach (System.Type type in assembly.GetExportedTypes())
{
listBox1.Items.Add(type.FullName);
if (type.IsClass && !type.IsAbstract)
{
object instance = System.Activator.CreateInstance(type);
}
}
listBox1.EndUpdate();
}
--
Milosz Skalecki
MCP, MCAD
" XXXX@XXXXX.COM " wrote:
> Hi group!
>
> Is it possible to scan an assembly *which has NOT been added as a
> reference* for types, and dynamically create instances of the loaded
> types?
>
> I have a program, MyProgram.exe, which at runtime uses
> Asseembly.LoadFile(...) to load an assembly, MyAssembly.dll. When
> MyAssembly.dll is added as a reference to the MyProgram project,
> serialization and de-serialization works lige a charm.
>
> However, when I remove the reference to MyAssembly.dll in the MyProgram
> project, I get an exception upon de-serialization.
>
> Is there something I can do which is like "adding an assembly as a
> reference at runtime"?
>
> The best,
> Mogens
>
>
5.Binary Serialization - Need Advice on How To Prevent Developers Accidentally Breaking Serializations
Hi all,
We have an object graph that we persist to disk using binary
serialization. The issue that we are trying to find a solution to, is
how to prevent developers from accidentally breaking serialization, by
adding a new object to the graph which is not serializable.
I was hoping to add a Nunit test to our suite which would fail if this
object graph is not serializable. However, after having done this
once in Java, I realized it is not so straightforward.
(In Java, if your object contains another object which is not
Serializable, it won't fail if the child object is null at time of
serialization. So our unit test had to use Reflection to iterate over
the public and private fields of the entire object graph to test that
each member implemented Serializable).
I'm wondering if, in .NET there is some easier way to test that the
entire object graph is serializable? (If the solution is have your
test populate every field with data, and then try to Serialize, we
might as well follow the same model as we did for the Java code).
Thanks for anyone's thoughts on this...
Sam
6. Serialization - DeSerialization - Serialization Issues
7. XML Serialization Vs Breaking Domain/Business Logic Vs Custom Serialization
8. Recursive XML serialization? XML serialization of cyclic objects?