I am writing a .NET application for Windows Mobile 6.5 (based on 3.5 CF).
I imported the wsdl and Visual Studio (2008) generated a webservice consumer, I can see the code in Reference.cs and I have a vague understanding of what it does.
The application is consuming a webservice. And I need it to be faster (customer demands). Right now a roundtrip takes about 500ms, I found the backend takes about 200ms which means my part is the bottleneck with 300ms.
Before I start trying and writing code to try things out, maybe someone else can provide the answers to these question, avoiding me a lot of trouble and work.
The webservice itself is hardly customizable, there are a few options that do not seem to have a lot of effect (URL behaviour, preauthenticate).
Upon googling I found 2 statements:
- http://msdn.microsoft.com/en-us/library/ee704594.aspx says I could create a pre-generated XMLSerializer. Only this article is about MS Dynamics CRM. Does it apply to Visual Studio? I have the feeling the Reference.cs is already XMLSerializer-code.
- http://blog.westmonroepartners.com/mobile-web-services-jsonrest-vs-xmlsoap/ here I found the quote
the .NET Compact Framework on Windows Mobile, JSON deserialization was literally thousands of times faster than XML deserialization due to poor performance of .NET reflection on the platform.
So that could be something. I could go for JSON, or, since the amount of operations/properties is very limited (and I do not expect a lot of changes) I could write some code to deserialize without using Reflection. The questions: can somebody validate the quote? Would not using Reflection be an answer to my optimization-question?
Thanks in advance for all your great insights and shared knowledge :-)