OpenNETCF's XmlSerializer

  • Thread starter Thread starter Joshua Moore
  • Start date Start date
J

Joshua Moore

Ok, so I understand you have to have properties to use OpenNETCF's
XmlSerializer and I have way too much code to go back and use:

public duh
{
get
}
{
set
}

So I've reversed my course and decided to use the .net framework on a
regular pc to do the serializing, but the deserializer won't work either,
I'm guessing for the same reason.

Please help.

Thanks,
Joshua Moore
 
You are correct - the deserializer is a mirror of a serializer and has the
same requirements. If you have access to the VS2005 Preview, it supports
refactoring, including easy conversion between member variable and a
property.
 
Do you know if supporting member variables will be included soon in
openNETCF? Really appreciate the help and answers.
 
Are there any major differences? Thanks for the suggestion, I totally
forgot about BinaryFormatters.
 
The binaryformatter is in System.Runtime.Serialization, which I can't find
in .NETCF. Is there a reference I need to include?
 
casey said:
www.go-mono.com has C# BinaryFormatter code.
i ported it over to CF in about half a day.
cannot release my code for legal reasons,
but somebody else could do it easily enough.
would just have to be careful of licensing issues.
casey

Casey, can you give any advice on how to use the Mono binary
serialization with a WebService?

Thanks,

R.
 
thats kind of tricky.

3 serialization option are:
XmlSerializer which is used by Web Services,
SoapFormatter and BinaryFormatter which are both used by Remoting.

CF v1.0 does not provide us with access to any of those,
no Soap / BinaryFormatter because no Remoting.
although we know there is some sort of XmlSerializer,
because CF can make web service calls,
we just dont have access to it until v2.0
(or use what OpenNETCF provides now).

so if you port the BinaryFormatter over, how would you use it with a web
service.
first option is to Binary serilaize the data, and then base64 it to send to
a WebService.
second option is to use the CF DIME library.
either of those could be used to transfer the data ... i prefer DIME;
although its a little harder, and the Web Service has to have WSE on it.

what really matters though is if the Mono binary formatter is byte
compatible with the Microsoft version.
so that if you binary serialize with Mono, if Microsoft can deserialize, and
vice versa.
i think it is ... but not entirely sure?

Thanks,
casey
http://www.brains-N-brawn.com
 
Thanks Casey, I didn't think it was an easy job, but I thought I'd ask
just in case :-)

My reasons for wanting to do this is to avoid the localisation issues
that seem rife in any attempt to use Web Services across different cultures.

Well, maybe rife is a bit over the top, but these issues are a pain:
- DateTime properties get adjusted for timezone differences.
- Floating point properties get messed up because of different countries
switching the meanings of ',' and '.'.

I'm solving these issues by providing an additional attribute where I
convert the property to/from a string in en-US and let the XmlSerializer
use that rather than the native property, which I put an XmlIgnore
attribute onto. Seems rather ugly though and I wish there was a better way.

R.
 
Back
Top