Windows 10 IoT - Supported bindings - wcf

According to
https://msdn.microsoft.com/en-us/library/system.servicemodel
the Windows Universal Platform supports the NetHttpBinding. In Visual Studio, I can develop a simple WCF client using this binding, without errors. I can use the NetHttpBinding class of the ServerModel namespace. When I deploy the client to a Raspberry Pi 2, a
PlatformNotSupportedException
occurs.
Which WCF bindings are really supported by Windows 10 IoT?

There is almost no information available public about WCF client profile for windows 10 IoT, but I think it's very easily for you to test them. It's still a prerelease preview, so it's really possible.
To move forward, I think you can use HttpClient in System.Net.Http namespace to consume restful service. check Jeff Sanders's blog.

Related

Bundle WCF service along with Universal Windows App

I realize that we cannot directly access SQL Server database from a UWP app, and have to use a WCF service as a mediator for this. (Which is totally stupid, since even competitors like MySQL provides API for Microsoft's runtime, while Microsoft's own RDBMS does not!)
I don't have any experience with WCF, but after going through some tutorials, I believe I can make a WCF service to communicate with my SQL Server (although I do not like making my simple application use a 3-tier architecture, which shouldn't be imposed on me). Anyways, I do not want to host this WCF service on my website, since I'm making this only for this UWP app. Is there a way I can bundle/pack this WCF service along with UWP app itself, such that service runs on client machine only when thhe start my app, and stops later when app is closed/suspended/minized.
The UWP app I'm developing, also have a WPF version and a web version (in ASP.NET), all of which were connected to MySQL database till now, and it worked flawless. Recently I decided to shift to SQL Server since I'm using Microsoft technologies for all my softwares and thought SQL Server will have better integration and support. But now I find it rather opposite, and thinking to switch back to MySQL database.
You can not bundle a WCF service (or REST api) with your Universal Windows app. UWP apps run in a sandbox environment on a different .NET runtime than your WCF service. You could run the WCF service in IIS, or even better create a self-hosted ASP.NET WebAPI project (so no need for IIS) to access your database. But this service will have to be installed separately from the app.
Note that because UWP apps run in a sandbox, some in-app databases like SQLite are inside this sandbox and can not be accessed by your other apps (WPF, website) by default (there are some hacks to bypass this).
So I think your best bet is to stick with MySQL and use the MySQL connector.

Using Portable Class Library with a Universal Windows App for Win 10 (UWP) and Windows Service

I am currently writing a Win 10 UWP project that provides administrative control for a windows service. I was unable to reference a standard class library that contains my model layer. This Model layer hold objects that I want to share with another project that is a Windows Service project. What is the best way to do this and can I create a UWP app as a standard long running Windows Service? Would I be better off porting the Windows Service to a WCF project and can a WCF run as a Windows Service? I'm confused with the new server offerings for Win 10 and Win Server 2016. The Windows Services that I wrote use custom protocols based on serialized objects with a binary serializer. Apparently that has changed as well with the new windows sockets models which seem to require that objects are serialized into a string. I'm very confused by all the recent changes and lack of Microsoft documentation. The only proper books that I found on Amazon are all for pre-order for the middle of next year.
Solved my own problem. The trick is to upgrade the Windows Service and it's layer projects from the 4.5.2 build to 4.6 and then use a portable class project for my model layer. Switching out Binary Serialization to JsonConvert and bang it works.

Need advice: SignalR support for Windows XP (.NET 4.0)

I am developing some kind of communication and data-interchange system to use in various applications that my company is producing. There will be SignalR hub for messaging and WCF service for file streaming.
I was thinking of developing a Hub library in .NET 4.5. Also I plan to enable Hub hosting in some windows process and IIS.
Thing that bothers me is that I have to support Windows XP clients, so I cannot use .NET 4.5 for developing a client library.
My question is: Are there bad effects of providing a .NET 4.0 client library for all clients, even though there are more clients with Windows 7 or Windows 8? My concern is about performance and features - am I going to lose any of that if I go with .NET 4.0 client?

Handle Wcf wsHttpBinding on Linux

I'm involved in a project with many others companies. We started to develop our systems at the same time but only at the end the communication problem was taken into account.
I've developed my system on Linux with Mono (Linux is mandatory for me). I have to communicate with a Windows .Net system which is exposing a Wcf web services. Unfortunately they told me only now they are using wsHttpBinding and I've just discovered that this communication protocol is not supported by Mono.
I'm here to ask if there is a way to communicate with that web service. They are not going to change the wsHttpBinding because is used by many other companies. I cannot change my OS and my code base is too big to leave Mono now. I can only add a layer (always on Linux) between my Mono implementation and their web services.
Any suggestions?
Microsoft has recently released the .NET source code as MIT licence (open source).
This means that, if something is not supported by Mono, you can just bring the code yourself and incorporate it, so that it becomes officially supported.
Some Mono developers have actually been doing this the past weeks to incorporate things that they had not implemented yet. So you could bring the wsHttpBinding along to Mono. An example of such a change is this commit.

PerSession WCF Service with Callback for Silverlight client

We would like to develop WCF service for SL clients, which should support session management (PerSession) and callbacks. The WCF service would be hosted as a Windows service.
What would be best WCF binding choice (wsdual, pollingDuplex, any other)? Please also provide for/against points.
Regards,
There are no others. Silverlight does not support WSDualHttpBinding. You can choose PollingDuplexHttpBinding or PollingDuplexHttpBinding.
Have been working a little more in this area and it appears this is an area of constant and recent change. As of Silverlight 4, NetTcpTransport and HttpTransport are both supported using either text or binary encoding. It appears SL5 delivers further enhancements.
There is an interesting benchmark app here which allows you to profile relative performance of the two protocols. Though it was built for SL4, you can download, update the target framework to SL5 and see how it goes. It is a great way to make sure you've got everything setup properly.
Using NetTcpTransport should mean you can also use PerSession instancing on the server.