Create WCF service with Integrated Windows Security on IIS7 - windows

I'm trying to create a WCF service that uses Integrated Windows Security and will be hosted on IIS7.
This service is going to be used inside a domain and will be consumed by a java client.
My questions are:
What bindings should I use ?
How do I set up Integrated Windows Security on IIS7? (not the same as IIS6)
How do I get the credentials inside the service (C#), that is, how to read the user name.?
Thanks,
Thomas

Related

Okta sso for native app accessing web services

We're getting ready to rewrite an old native windows mobile application that accesses data through a VPN. We'd like the new version (.NET Windows 10 mobile application) to access data through web services that are protected by Okta. What is the best way to do this?
Thanks!
The best way to do this depends on how the web services are protected.
The main thing to keep in mind is that you don't want to store any secrets on the mobile application.
In an ideal world, these web services would be secured with something like OpenID Connect (OIDC), allowing you to authenticate against Okta (the "IDP") to get access to the web services (the "Relying Parties").
However, the real world is messy, where some web services are protected via SAML, OIDC, OAuth, custom headers, etc.
Without knowing more about your setup, my recommendation would be to build against OIDC, using a proxy server (or "API Gateway") as needed to secure your web services using OIDC.
One of my co-workers at Okta has written a sample iOS application in Xamarin that implements OIDC, I suggest taking a look at the ViewController.cs file in that repository.

Windows phone 7 - how to connect to remote services

I want to connect to remote machine using windows phone 7.5. Is there any inbuilt classes in .net for this.
For regular desktop application same can be done using ServiceController class. I am looking for the similar class for windows phone application.
ServiceController is used to control state of services on local or remote machine.
WP apps don't have a way of controlling remote or local services.
You would have to write SOAP or REST API for managing services and then connect WP app to those, but do make sure it is secured properly - you don't want to give access to service control to everyone.

Accessing a non silverlight enabled web service from a Silverlight Phone Application

I'm trying to access a WCF web service (that is NOT silverlight enabled) from a Windows Phone Application using Silverlight.
I am able to add the service reference fine and I can see all the methods on that service.
The problem I'm having is that when I actually try to call a method I get an "EndPointNotFoundException."
I've read many examples that use a web service which is SilverLight enabled.
My question is: Is it possible to use a web service that is NOT silverlight enabled in a Windows Phone Application using Silverlight?
Test the service with the WCF Test Client and see if it works. In case there are no errors, make sure that the service is using basicHttpBinding (and not wsHttpBinding, as I see in a lot of services - it is not supported on WP7).

wcf windows service interaction

I have a windows service in which i host a wcf service.
What is the best approach to control the windows service via the wcf service? I already created the interfaces for the wcf service, but I have no idea how to interact with the windows service's classes and functions.
just to check that I'm understanding your problem correctly - you want to run a wcf service, so you create a windows service to host it, and you want your desktop client to be able to control the windows service (that's hosting the wcf service) by talking to the wcf service?
If that's the case, what is it that you're trying to do with the windows service? In some of the work I've done, I've set up the server such that there's the windows service hosting all the wcf services I want to run, and in order to interact with that windows service remotely (e.g. starting/stopping/restarting) I have another service running on the server (usually baked into the Amazon instance image so it's running on every new server that gets brought up) which my remote client can talk to instead. That way I have a means to trigger a service restart on all my servers without having to manually connect/remote desktop to each server. Of course, the second wcf service is secured by some means so it can't be exploited easily.
Is that the sort of thing you're looking to do?

Writing Windows service in WCF

I want to write windows service in wcf After searching a lot I only found were tutorials of writing webservice in wcf not windows service.
Can any one please provide a link to any tutorial which explains how to write windows service in WCF
Windows services are executables. WCF applications are, generally, web services, exposed over a URI. You can host a WCF application within a windows service, not the other way around.
To create a Windows service in C#, follow the step-by-step here. To make your Windows service WCF-enabled, if you will, create the System.ServiceModel.ServiceHost instance that will host your WCF service inside the OnStart() callback.
Good answers all of them. Just a quick note... implement your WCF service in a class library (dll) so you can then host it anywhere you like (IIS, Console App, or Windows Service).
I'd recommend starting from a console application, after your service works as expected, create a Windows Service, add a reference to you library and start the service (WCF) from there (Windows Service)
Edit: I just assumed you meant create a WCF service hosted as a Windows Service, if that's not the case please ignore my answer.
Create your WCF service as normal, create a Windows Service and then use ServiceHost to self-host the WCF service in your Windows Service. See this MSDN page for more information about self-hosting WCF services.

Resources