WCF and Android Part I - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Wednesday, April 4, 2012

WCF and Android Part I

The Windows Communication Foundation (WCF) provides a very flexible way of exposing network interfaces to other applications. For cross platform and inter programming language support basically two technologies can be used. SOAP and REST services. The SOAP approach provides far more features out of the box but is not really suitable for mobile devices if speed matters. Therefore this article describes how to create a REST WCF-Webservice which can be consumed on android devices.

WCF part

The WCF part is composed of three files, the service contract, the service implementation and the app.config.

The service contract 

The service contract defines the webservice methods.

To expose the service via REST, the WegGet attribute is required. It specifies the URL of each method, the serialization format (JSON or XML, use JSON for fast processing). If the method has parameters they can either be provided using POST (requires another attribute) or they can be provided by specifying them in the URL as shown in the example. The implementation of this method is straight forward and requires no attributes.

No comments:

Post a Comment