Accessing a WCF service using Compact Framework

A few constraints when connecting to a WCF service from a Compact Framework application :
  • The binding must be set to basicHttpBinding, CF does not know what to do with a wsHttpBinding.
  • The XmlSerializerFormat attribute must be set on the service contract, the default WCF serialization is not suitable for the CF. It would throw an exception when deserializing.
  • Make sure you configure your endpoints correctly, "localhost" is not accessible from the mobile device (emulated or not), you can use ppp_peer as the hostname in the CF WCF proxy (a lot of CFs, I know).
Happy CF coding :)

Popular posts from this blog

Adding a delay before processing Textbox events

Handling exceptions the right way in WCF (part 2)

Create a draft release and start it using the TFS REST API