Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove unused namespaces from DataContractSerializer output

Is there any way to stop the DataContractSerializer from outputting xmlns:i="http://www.w3.org/2001/XMLSchema-instance" in the first xml tag? It isn't being used and I am trying to fit my messages under 1KB so they will be delivered by Raw Push Notifications for Windows Phone 7. I've already gotten it binary serialized and removed all other namespaces. Any help would be appreciated.

Thanks!

-- Edit -- I meant 1K, not 1000K, lol

like image 761
James Avatar asked Nov 15 '22 00:11

James


1 Answers

This is not execly what you ask, but one way to compress the data is to give your members a shorter name

[DataMember(Name = "ID")]
 int IdNumber;
like image 96
Lukasz Madon Avatar answered Mar 06 '23 23:03

Lukasz Madon