views:

42

answers:

1

Hi there,

I've currently got a class similar to this:

public class myClass
{
**[XmlElement("mcp")]**
public int MyClassProperty;
}

This is to try and reduce the length of the property name for when the class is serialized in a web service call. However I want the class which references myClass via the web service to use MyClassProperty not mcp.

What is the best way to control the serialization to minimize the amount of data to transfer but retain the original property names?

A: 

You'll probably need to write your own serialization/deserializarion routines, to compact your message data and decompress it preserving original names.

If you don't need to send all your object data, you could pass that data as method arguments.

If you're using WCF to communicate with that data structures, you could to avoid write new code by switching your protocol, to net.tcp for instance.

Rubens Farias