I have developed a self-hosted WPF server application and a client WPF application which communicated with WCF NetTcpBinding with duplex like common connected TCP socket communication scenario.
Now, I will develop a mobile client which communicates existing self-hosted WPF server application.
I know that old Xamarin does not support NetTcpBinding.
Does the latest Xamarin Forms (or Xamarin.Android, Xamarin.iOS) support NetTcpBinding with duplex? It seems that .NET Core 3.0 supports NetTcpBinding, but I have no idea for Xamarin.
If Xamarin does not support WCF NetTcpBinding, is self-hosted SignalR a good alternative for full duplex connected communication?
As far as I know, Dotnet Core3.0 SDK supports the Nettcpbinding and I can generate the client proxy class properly by using Microsoft WCF web service reference provider. Thereby it supports duplex communication too.
I didn’t have much exposure to Xamarin. If the project based on the Core 3.0 SDK. I think it should be capable of supporting Nettcpbinding.
Feel free to let me know if there is anything I can help with.
Related
What I observed is:
The System.ServiceModel.ServiceHost class is not available in .NET Core for UWP;
Duplex channel is PlatformNotSupportedException that doesn't support wcf callback.
So I wonder, UWP apps are designed to only work as WCF client? Isn't it possible to host a wcf service in a UWP app to make it like a server?
UWP Application worked in with limited folder access and limited capabilities.
To Host WCF Service it needs to act as web server. It does not have that capability included.
Below are the capabilities supported.
https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
I am new to WCF web socket and I am trying to implement duplex service using web socket. I have implemented the wcf web socket service using the following example and it works fine.
http://msdn.microsoft.com/en-us/library/hh977020.aspx
I know the minimum requirement for WCF service for web socket is windows 8 and .net framework 4.5. So I have hosted my service on windows server 2012 server machine.
Then I have written WCF web socket client to access the service and my client is windows
form applications runs on windows 7. I got the following error.
“This platform does not support client side WebSockets natively.
Support for client side WebSockets can be enabled on this platform by
providing an implementation of
System.ServiceModel.Channels.ClientWebSocketFactory.”
Does web service client also need to have windows 8? If it needs are there any third party libraries to access WCF web socket service.
Really appreciate your reply.
You will need win8 or 2012server to be able to use the Microsoft WebSocket namespace in your WCF. You could also take a look at SignalR that will fallback to other techniques when WebSockets is not available.
You can also use XSockets.NET that will run websockets on .NET 4 (so there is no need for win8 or 2012server).
You also have SuperWebSocket and Fleck as options of .NET 4.
Edit: Added sample with WebSockets from WCF .NET 4 here https://github.com/XSockets/XVA/tree/master/XVA-07-02-BoostWCF/Any%20OS
We are in the process of creating a new WCF web service (WCF service that has an basicHttpBinding Endpoint) to carry out some of our business logic.
The web application connects not problem at all, however our legacy Compact framework application doesn't seem to see the service at all.
Are we on to a loser here and should we just revert to ASMX web service (the Compact framework cannot be upgraded) or is there a way around this?
Yes you can but you need to treat it as a soap service not a WCF service with all the .net 3.5 goodness. Start up your web service and create web service reference in your .net 2.0 CF and use the auto generated code.
How can we consume WCF service in .Net 2.0 Winform. Please note that we don't have IIS on the client. an example or a sample would be great.
It all depends on how your WCF endpoints are configured.
If you're using SOAP based WCF Services over HTTP, you should be able to simply add a Service Reference from your .NET 2.0 WinForms application and be on your way (which is what I would suggest doing).
If that's not the case, you'll have to provide a little more detail about what you're trying to do with your WCF Services.
You can host your WCF service in a Windows Service as per this article. In that case, it will listen on the HTTP protocol on any port you configure.
I am new to WCF and Web Services in general. What are the improvements that WCF brings to the table? Can anyone give a side-by-side example of a traditional web service and the same one written using WCF and point out the differences and advantages?
Duplicate question Moving ASP.net webservices to WCF
EDIT: Think i found the answer you where looking for a side-by-side code based comparison and even better it's from MSDN: Comparing ASP.NET Web Services to WCF Based on Development
There are several related questions:
Difference between aspnet web method and wcf webservice
Benfits of using WCF
Moving aspnet web services to wcf
However you asked for a side by side comparison in which case i think Sam's Wcf vs ASMX blog article is more what you are looking for.
Quoting ad-verbatim (let me know if i should just leave it as a link):
WCF vs. ASMX
Protocols Support
WCF
HTTP
TCP
Named pipes
MSMQ
Custom
UDP
ASMX
HTTP only
Hosting
ASMX
Can be hosted only with HttpRuntime on IIS.
WCF
A WCF component can be hosted in any kind of environment in .NET 3.0, such as a console application, Windows application, or IIS.
WCF services are known as 'services' as opposed to web services because you can host services without a web server.
Self-hosting the services gives you the flexibility to use transports other than HTTP.
WCF Backwards Compatibility
The purpose of WCF is to provide a unified programming model for distributed applications.
Backwards compatibility
WCF takes all the capabilities of the existing technology stacks while not relying upon any of them.
Applications built with these earlier technologies will continue to work unchanged on systems with WCF installed.
Existing applications are able to upgrade with WCF
New WCF transacted application will work with existing transaction application built on System.Transactions
WCF & ASMX Integration
WCF can use WS-* or HTTP bindings to communicate with ASMX pages
Limitations of ASMX:
An ASMX page doesn’t tell you how to deliver it over the transports and to use a specific type of security. This is something that WCF enhances quite significantly.
ASMX has a tight coupling with the HTTP runtime and the dependence on IIS to host it. WCF can be hosted by any Windows process that is able to host the .NET Framework 3.0.
ASMX service is instantiated on a per-call basis, while WCF gives you flexibility by providing various instancing options such as Singleton, private session, per call.
ASMX provides the way for interoperability but it does not provide or guarantee end-to-end security or reliable communication.
WCF is far wider in scope than ASP.Net webservices.
WCF can run in any application. APS.Net webservices only run in IIS.
WCF supports models like ReST, Remoting, SOAP, MSMQ etc. ASP.Net only supports SOAP
WCF is more configurable.
WCF supports a more declarative way of programming. You can get more done with less code.
ASP.NET Web Services are pretty much just that. Web Services. They're SOAP/WSDL based and provide their services only to the web.
WCF Services offer a much more flexible framework. For instance, depending on how the service is defined, it can be a Web Service hosted in IIS which serialized its data via XML and uses the REST model...or it can be a Remote Windows Service that is hosted in it's own process and serializes its data via binary. All of this is achieved using the different Service/Data contracts in WCF.
In short...you can make a WCF service look almost identical to a .NET 2.0 Web Service fairly easily but, with a little work, you can do a WHOLE LOT MORE.