What are the minimum system requirements needed for WCF self hosted service to work?
My client application needs 2 way communication with the server and it will get deployed in systems having OS' XP, Vista, Windows 7. Is it mandatory to have IIS installed in the target PC to make self hosted services work or Is the only requirement is the need of .net 4.0 present in the system?
My application is going to be deployed on thousands of system which may have variety of configuration. In this scenario, Is self hosted service a good solution?
As you can see from this sample, ISS (or other HTTP server) is not required.
As the sentence says "WCF self hosted service" doesn't need IIS but it needs the windows feature. WCF is the evolution of the legacy marshall class objects. Today people use REST services to send data through a TOKEN. WCF is focused on desktop applications instead.
Related
I have a Windows Store - Metro app that connects with a Net TCP WCF Service running on same PC (hosted in a console application) but on Desktop mode of Windows 8. I have added a reference of WCF Service inside metro app and everything works fine.
I package my store/metro app and WCF Service and try out on another PC which don't have Visual Studio installed so I don't recompile the code, I just install the metro app package and run the executable of WCF Service. WCF Service starts fine but when I launch my metro app it give me error (see the image below)
It seems that for some reason metro app when installed on other PC is unable to find the service reference. I have tried many things after googling but nothing works. Any ideas/hint/suggestion would be greatly appreciated.
Windows Store Apps generally cannot use the loopback address, except for 1) communication within the SAME process, or 2) for development purposes. From How to enable loopback and troubleshoot network isolation:
Network communications using an IP loopback address cannot be used for interprocess communication (between two different apps) in a Windows Store app since this is restricted by network isolation. Network communication using an IP loopback address is allowed within an app within the same process for communication purposes.
A developer may want to use loopback for testing or debugging purposes, even though that capability will not be available for customers. For example, an app may want to download data from a web service from a Windows Store app. For development purposes, the developer wants to test the app on a single computer that is configured with the web service locally on 127.0.0.1.
Loopback is permitted only for development purposes. Usage by a Windows Store app installed outside of Visual Studio is not permitted.
In a production scenario, you will likely have to install the WCF service on a separate machine. Note that you will have to enable the "private network" capability in your application manifest (on the client app) to enable local network access.
I know you can call Windows Services from a Windows store app as described here, so I was wondering if it would be possible to install a custom one packaged with a Windows store app.
Thanks in advance.
Did you mean a WCF (web) service vs. a Windows Service (the latter isn't addressed in the link you referenced). Regardless, your application will not pass certification if it requires a loopback connection to a service hosted on the same machine.
You can set this up for testing, but note:
Enable loopback for network access
Network communications using an IP loopback address cannot be used for
interprocess communication (between two different apps) since this is
restricted by network isolation. Network communication using an IP
loopback address is allowed within an app within the same process for
communication purposes.
A developer may want to use loopback for testing or debugging
purposes, even though that capability will not be available for
customers. For example, an app may want to download data from a web
service. For development purposes, the developer wants to test the app
on a single computer that is configured with the web service locally
on 127.0.0.1.
Warning Loopback is only permitted for development purposes. Usage by
apps installed outside of Visual Studio is not permitted.
I am relatively green with C# and WCF. I have landed on a project where I am creating self hosted WCF services running as Windows services but am starting to wonder if I should use IIS instead (which we don't currently use) as managing all of these services could eventually get cumbersome.
Despite my best efforts, I have yet to find any definitive information about why I might favor one approach over the other. The services are primarily used for utility stuff like resizing images, retrieving files, etc. and are called by both C# and Java clients.
Thanks
The shortest answer would be 'it depends'. On your requirements. You can self host without problems, but IIS will manage resources more effectively and enable you to fine tune stuff more easily than self-hosted.
For instance, in IIS would be more simple to deploy a new version or remove and old one.
Either way is fine.
Generally, using the builtin IIS hosting capabilities can make deployment and configuration simpler for you. Also you have the activation model of http.sys - which means IIS will start the necessary process for you when an appropriate message arrives.
Clients of any platform can connect to the WCF services regardless whether they are self-hosted or IIS hosted.
ps: how to allow IIS-hosted WCF services to store their configuration data in distinct xxx.config files
I have a question regarding how to write a windows server side application.
We have now have a system whose client is .NET 4.0 based and a server side application running on jboss on Linux. The server application talks to an Oracle DB.
I am now thinking to move the server side to Windows and DB to SQL server. The server application should be written in C# on .NET as well. However, there seems no Application Server equivalent on Windows. How is a server application normally written and deployed on Windows?
Many thanks
There are a few options, but the very basics would be
Host WCF web services in IIS and take advantage of the management IIS offers, you can bring AppFabric into the picture for more robust and manageable hosting.
Self host your service in a Windows Service.
If it suites your application I would say the AppFabric solution is worth looking at. But this is not a 1-to-1 with with a Java Application Server.
Update
Self hosting WCF is as simple as the follow
host = new ServiceHost(typeof(YourWcfService));
host.Open();
This assumes that you have defined a service called YourWcfService'. The above code in theOnStart` of a Windows Service will start accepting requests to your service. Of course this still requires all the basic configuration in the app.config file.
AppFabric, however gives you a nice environment to manage and monitor your services, so not to sound like a broken record, but I would look into it to see if it is possibly a good fit for you.
Update 2:
I did a quick bing and found this MSDN post, it is oldish but looks like a good example.
http://msdn.microsoft.com/en-us/library/bb332338.aspx
It's not exactly true, there are couple of almost unknow but powerful tools that you can use free:
NetFluid: http://www.netfluid.org/
Service Stack: http://www.servicestack.net
In a Windows Server 2003 environment with a self hosted .Net 3.5/WCF application, how can an application report its status to a BigIP Local Traffic Manager?
Example: One of my services errors. My custom WCF application hosting software (written because Windows Server 2008 is not yet available and I'm using WCF TCP bindings) detects this and wants to report itself as down until it can recover the errant service. It needs to report itself as down to the BigIP LTM so that it is no longer sent client originated requests.
For the scenario you describe I would use iControl (SOAP/XML based management API) to have the application tell BIG-IP it is down. Basically you'll just be setting up a SOAP call to BIG-IP and invoking a web service with the appropriate information so BIG-IP knows the application is down.
You can find the documentation and download the SDK as well as .NET assemblies at DevCentral (devcentral.f5.com). There are also other folks out there that can help you if you need it in the forums.
Though I will also say that BIG-IP will notice the application is down and should automatically remove it from service until it notices it is back in service. That can be configured through the use of monitors attached to nodes.