开发者

.NET CF 3.5 Reducing Xml Property Name Lengths

I've cu开发者_C百科rrently 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜