开发者

.NET CF 3.5 Reducing Xml Property Name Lengths

开发者 https://www.devze.com 2022-12-11 18:44 出处:网络
I\'ve cu开发者_C百科rrently got a class similar to this: public class myClass { **[XmlElement(\"mcp\")]**

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

精彩评论

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