create window service and call wcf service - wcf

In my Application we used Android for native application and wcf service for maintain backend . Requirement is to send notification to tablet periodically. I think to use window service and call wcf service.And on my server only .Net framework is there. But i don't know how to create windows service and call wcf service.
My requirement is to call wcf service on the base of date which stored in database. Example if 30/04/2013 is stored than wcf service will call automatically on 30/04/2013

There are many tutorial about to consume a "WCF" web service on an android device. Here's one that I find well documented.
Comsuming WCF Services With Android
WCF and Android Part I
WCF and Android: Part II
Comsuming WCF Services With Android
I hope this help you

Related

Receive wcf Callback in Asp.net Core application

I am having a Duplex WCF Service hosted on console. This is tested and worked fine.
I want to consume this WCF service in Asp.net Core. I have done this using this https://medium.com/#narinkaew/using-wcf-soap-services-in-net-core-fb13180c4eda Consume WCF in Asp.net Core.
I am able to get response, but I am not getting any callback. Its just keep waiting.
I have uploaded the Code https://filebin.net/pf9eplqjncc0octj.
ClinicWcfService - is wcf Service Application
HospitalServiceHost - WCF Service Hosted on Console
ServiceEngineersDesk - is Asp.net Core Application.
Can someone tell me how to get a WCF callback in asp.net core application?
I have done this from my side.
Instead of creating instance of interface of the wcf service, create a instance of interface implementation.
Now this class exposes the event of the callback. Just subscribe to it
After a some struggle i was able to found out.

UWP app as wcf server?

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

How do use WCF to communicate between an Application and a Windows Service?

I've gone through some tutorials on creating a WCF service. I'm using Visual Studio 2012. I got a very simple WCF Service Library (vb.net) and Windows Application (vb.net) communicating via WCF. That's a start.
However, my project requires I do the following:
My Windows Service - This is already an application that has it's tasks.
My Application - This is an application that is already developed as well.
I need the service to talk to the application. The service will need to send the following information to the windows application:
Status Updates
Metric Information (mostly integers for counts)
I need the application to send information to the service. It would need to send:
Reload Configuration command
Should be relatively simple, but I've never worked with WCF until today. So I have some questions...
Do I need to re-work my current windows service into a WCF Service?
Since it won't be in IIS, do I also create a WCF Service Library or do I roll this into the windows service somehow?
What is the best way to set up the different types of communication? (i.e., sending over specific metrics and reload commands)
Probably the main question is what components, in addition to my current windows service and application, will I need to make this work?
I hope that was clear :( I think I'm confusing it all... but I hope not
Your Windows service can host the WCF service. Similarly, if you want, your application can host a WCF service. The application could talk to the WCF service in the Windows Service, and the Windows Service's WCF could talk to the one in the application. Depending on the nature of the communication, you could also just use a callback channel to permit the Windows Service's WCF to call back to the application.
I suppose you should configure your WCF windows service to use named pipes. If your windows service is already built then the easiest way to do it would be to build another one as a WCF windows service and wrap the already existing functionality.
Hope I helped!

SignalR - Sending a Message from a WCF Project

I've followed the instructions from https://github.com/SignalR/SignalR/wiki/Hubs
entitled "Broadcasting over a Hub from outside of a Hub".
I got this method working from within an MVC Action in the same project. Requesting the Action sends the update to connected clients.
My problem is that I need to be able to send updates from another project, in particular a WCF Web Services project. My app has an API and a web component and when API users make calls that change things, these updates need to be pushed out to the Web clients via SignalR. And calling a web service with the same code as my Test Action doesn't work.
I also tried the same code inside an nunit unit test that didn't work either.
What do I need to do to make this same method described on the Wiki work for a WCF Project?
The easiest solution is probably to provide an API on your Web Application (use MVC or the new WebAPI) that broadcasts to all connected clients. Any other application (an NT Service, an NUnit test, ...) can call that API if it wants to send a message to the clients.
You can't expect SignalR to do anything if you aren't hosting a Hub either in a Web Application running under IIS, or another application hosting it directly.
If you need two-way communication from your separate application to your clients then simply make your application into a SignalR client too and have it communicate via the Web Application hosted SignalR to the clients and have it listen to messages from them too.
For example, here's how I have configured a complex Service + WebSite + Clients solution (ignore the purple for now):
The Live Web Server allows NT Services to connect and create SignalR Groups. NT Services send to those groups. Web browsers connect to a group and receive messages send to that group. In effect the middle box becomes a pubsubhub.
I cannot get exactly what you aim. But if I understood correctly you're trying to send some kind of notifications raised inside WCF services to SignalR clients.
If that's the case; I can suggest you my approach:
I have some WCF services and a SignalR hub in the same application server. IMHO, the best way to communicate WCF with SignalR hub is by using MSMQ.
When a notification occurs inside a WCF service, it puts the notification payload into MSMQ.
On the other end, SignalR hub listens the same queue. When a message put into the queue, it gets the content and broadcasts to the hub clients. Very easy and straightforward. No extra service/hub call at the server side.
SignalR hub can listen for new queue items by using System.Messaging.MessageQueue#ReceiveCompleted method. When this event raised, SignalR hub gets the queue item and broadcasts to its clients.

How can a I publish data to a WCF duplex service, from non-Silverlight client

I have a Silverlight app, that uses a WCF duplex service extensively (therefore I don't want to change from duplex on that side of things).
I wish to stream data from a Windows app, via the WCF duplex service to any connected Silverlight client. However I believe that only Silverlight clients have an API to call duplex WCF services (based on PollingDuplexBindingElement).
Therefore, I thought perhaps that I could have a non-duplex WCF service on the same website,to which the Windows client pushes data, and somehow trigger the duplex service to forward on the messages. But to start with, the non-duplex service is effectively a windows app as well and gets the same errors if it tries to call the duplex service.
Finally, I have concluded I will have to use a shared queue / bus between the services and would like recommendations as to a good approach. I am looking for the best performing (low latency) solution.
The link below there is a good sample which consumes a wcf duplex service from a wpf client.
http://petermcg.wordpress.com/2008/11/19/silverlight-polling-duplex-part-4-wpf-client/