0

Communication between a desktop application and a web application

suggested using a service. What specifically can be used by both WPF and WP app? WCF services are consumed easily by WPF, but not so easily by WP app:

http://blogs.msdn.com/b/myamama/archive/2014/06/24/workaround-to-adding-service-reference-to-windows-phone-8-1-runtime-app.aspx

I wouldn't like to use it like that, with the suggested workaround.

I saw in Visual Studio that I can add azure mobile service reference to both WP and WPF. Would this then be the way to go, to use common repository with both applications?

Community
  • 1
  • 1
Mefhisto1
  • 2,188
  • 7
  • 34
  • 73

2 Answers2

1

Yes Azure mobile service reference is a good solution.

You can also choose to make a Web API service that can be hosted on premises, in your company. A Web api service can be hosted in IIS or in self hosting (in a console of Windows service application - without IIS).

Wep API services expose JSON and POX (Plain Old XML) on a REST model that can easily be consumed by any mobile client including Windows Phone applications.

EDIT Those Web API services can easily be consumed by "heavy" .Net client that have the full blown .Net Framework (WPF, Windows Forms and ASP.NET) They have WebClient of more recently HttpClient to access the server and Linq to xml (and also XML Readers that are also more performing but less easy to use) to get the payload data.

Regards

Emmanuel DURIN
  • 4,803
  • 2
  • 28
  • 53
1

Honestly, world is shifting towards using REST services. We, for instance, create a web api mvc application and put the logic there. Then, in projects that are clients of these services, we use RestSharp library (really good wrapper over webclient) to query our web api services in the same time knowing that restsharp will translate our models (objects) to json and the other way arround.

jjaskulowski
  • 2,524
  • 3
  • 26
  • 36