.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

nettcpbinding with windows security in iis hosted service

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :.NET Framework
 

Hi ,

I have hosted service in iis. How can i verify my service (transport mode)is using windows authentication for client.

when i use basichttpbinding and set clientCredentialType to windows, but iis with anonymous. When i browse svc, as expected i get error that secrurity setting of servcie needs windows but iis is configured as anonymous. Similar i see expected bheavior when service is configred for anonymous, but iis is configured for windows.

But when i use nettcpbiding, irrespective of what my iis setting is (windows/anonymous), if i configure service for windows and i browse svc file. I am always able to do to without any error. when service is configured for windows and iis for anonymous; shouldn't i get an error (as seen in case of basichttpbinding)

Regards


singhhome


View Complete Post


More Related Resource Links

Windows Identity Foundation Security Token Service can't stay logged in

  
I'm using the Windows Identity Foundation **(WIF)** Security Token Service **(STS)** to handle authentication for my application which is working all well and good. However I can't seem to get any long running login with the STS. From my understanding I shouldn't care about the client tokens at the application level since they can expire all they want to and it should redirect me to the STS and as long as they're still logged in on the STS it should refresh their application token. Yet it doesn't seem to want to keep them signed in. Here's what occurs in my login.aspx on the STS var cookie = FormsAuthentication.GetAuthCookie(userName, persistTicket); if (persistTicket) cookie.Expires = DateTime.Now.AddDays(14); Response.Cookies.Add(cookie); var returnUrl = Request.QueryString["ReturnUrl"]; Response.Redirect(returnUrl ?? "default.aspx"); Which was taken almost directly from existing application using normal Forms Auth. From my web.config <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="2880" name=".STS" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false" /> </auth

Question about WCF Service hosted in Windows Service

  
Hi, I have little experience with WCF and working on a projet that requires WCF Service instance to run 24x7. After searching for a solution and reading about WCF, I think if I host it under Windows Service I can have a single instance of WCF Service running 24x7. Is this correct? I just successfully ran the MSDN sample project that hosts CalculatorService in Windows Service. I realized that Windows Service cannot communicate with WCF Service it is hosting (I do not have any experience with writing Windows Service). I wrote a test function (public) in Windows Service and tried to call it from WCF Service but it did not appear in the Intellisense list. Is my assumption correct or is there a way to establish communication between Windows Service and its hosted WCF Service? Thanks. kr

Security settings for this service require Windows Authentication but it is not enabled for the IIS

  
Hosting service in IIS 5.1   Config is set to transport layer security. SSL is installed and configured on the virtual folder and BasicHTTP bidings are being used for connection. Authentication in web.config is set to Windows Authorization in web.config is set to Deny Users="?" and Allow Users="*"   When trying to connect to the service using IE, it throws exception that "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service. "   Can some one tell me what is missing?   Do I have to set anything in Web.Config?   I need to achieve following using Basic HTTP binding   Transport Layer security (SSL), Windows Domain Authentication, Use  user's Domain identity to impersonate the user in service   Please suggest the settings if any   Thanks

Security settings for this service require Windows Authentication but it is not enabled for the IIS

  

Hi,

 

We are getting the following error, when we call a WCF service from IE. The service is developed in MS.NET 3.5 and hosted in IIS 6.0, Windows Server 2003 SP2

 

Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service.

 

NOTE: The same is working GOOD in IIS 6.0, Windows XP SP2

 

IIS Setting

 

"Integrated Windows Authentication" is enabled in the "Directory Security"

 

Web.Config

<system.serviceModel>

<bindings>

<basicHttpBinding>

<binding name

WCF hosted in a Windows Service, how to make calls to the WCF service from within the service host

  

I have a Windows service that I converted to a WCF service that I want to host in a Windows Service.  I need to do some specific tasks in the OnStart() and OnStop() just like I did when it was just a Windows service.  My original Windows service OnStart() is where I create the main worker thread.  So how do I make a call into my WCF service from within the hosting service? For example in the hosting service's OnStart() I do a host.Open() then I need to call a method in my WCF service but how?

 

 

ServiceHost host =

TCP Error Code 10060 when attempting to access WCF Service hosted by WIndows Service from client run

  

Hello all,

We have a Framework 3.5 WCF Service which is in turn hosted in a Windows Service using Net.Tcp Binding. SvcUtil is used to generate the proxy which is used instead of a service reference in the client code. We are also using Tcp Port Sharing. The endpoint address is net.tcp://HostMachineName/MyServicePath. The service logs to the Event log and everything works perfectly on the same machine.

When attempting to run the client from a different machine we are getting TCP Error Code 10060 errors. Below is the error message:

System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://HostMachineName/MyServicePath. The connection attempt lasted for a time span of 00:00:20.8592415. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.22.333.444:808.  ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 111.22.333.444:808... The IP Address displayed was the correct IP Address for the HostComputerName.

Has anyone encountered this problem? Also, client specs say no config files, so anything that wo

IIS hosted nettcpbinding security

  

Hi,

I have hosted my service in IIS with nettcpbinding and IIS set to Windows auth and Anonymous is disabled. when i browse svc file i get error "security setting of service required anonmous but is not enabled on iis application site".

when i use below config file, i get this error. But when i use second config setting, i don't get this error. I am not able to figure out the diffference in 2 config files.

1.  (this setting doesn't work)

<system.serviceModel>
<behaviors>
   <serviceBehaviors>
    <behavior >
     <serviceMetadata httpGetEnabled="false" />

IIS hosted nettcpbinding security issues

  

I have hosted my service in IIS with nettcpbinding and IIS set to Windows auth and Anonymous is disabled. when i browse svc file i get error "security setting of service required anonmous but is not enabled on iis application site".

when i use below config file, i get this error. But when i use second config setting, i don't get this error. I am not able to figure out the diffference in 2 config files.

1.  (this setting doesn't work)

<system.serviceModel>
<behaviors>
   <serviceBehaviors>
    <behavior >
     <serviceMetadata httpGetEnabled="false" />

IIS hosted nettcpbinding security issue

  

Hi,

I have hosted my service in IIS with nettcpbinding and IIS set to Windows auth and Anonymous is disabled. when i browse svc file i get error "security setting of service required anonmous but is not enabled on iis application site".

when i use below config file, i get this error. But when i use second config setting, i don't get this error. I am not able to figure out the diffference in 2 config files.

1.  (this setting doesn't work)

<system.serviceModel>
<behaviors>
   <serviceBehaviors>
    <behavior >
     <serviceMetadata httpGetEnabled="false" />

IIS hosted nettcpbinding security issue

  

Hi,

I have hosted my service in IIS with nettcpbinding and IIS set to Windows auth and Anonymous is disabled. when i browse svc file i get error "security setting of service required anonmous but is not enabled on iis application site".

when i use below config file, i get this error. But when i use second config setting, i don't get this error. I am not able to figure out the diffference in 2 config files.

1.  (this setting doesn't work)

<system.serviceModel>
<behaviors>
   <serviceBehaviors>
    <behavior >
     <serviceMetadata httpGetEnabled="false" />

How to debug Windows Workflow when it is hosted by WCF Service ?

  

Hi,

I have build a test solution in two parts :

1) WCF service which hosts a Windows Workflow (statemachine).

2) Console application which consumes the WCF Service.

It works well, but if I do a bad process, it crashes which is normal. Exemple : the client calls an event which is impossible to execute given the current state according to the workflow design. In this case, the client receives a WCF exception. This exception is masked, which is normal (an option has to be set in WCF side to enable exception transmission).

The problem is that, althought I launched the console application with the debugger, with the WCF service project, the debugger doesn't break on Workflow errors in WCF error side. (However, I saw that non-Workflow errors in WCF side are still stopped by the debugger)

How could I force the VS debugger to break on Workflow WCF errors ?

Thanks.

(Workflow 3.5)


WCF service hosted in IIS 7 returning error "Security settings for this service require 'Anonymous'

  
Using the CalculatorService provided as a WCF sample from MSDN, I tried to host it as an application in IIS 7. The virtual folder in IIS is configured as Basic Authentication enabled and Anonymous Authentication disabled. I don't have any certificates setup. This is all hosted in a single machine setting. Each time I access the service through a browser, I'm getting the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service".

Below is my web.config --

Can someone please provide some answer, I don't want to enable Anonymous authentication in IIS. I even set the 

aspNetCompatibilityEnabled = true.

<?xml version="1.0"?>

<!--

How to create a WCF web service using TCP protocol hosted on windows services and compatible with no

  

Hi,

I need to create a WCF web service . My service will operate on LAN hence I wish to use TCP protocol for that.

So I need to host that web service on windows service.

But I don't know how to make that web service compatible with other platforms.

I wish my service should be platform independent.

If anybody knows the solution then pls let me knw.


How to enable windows authentication for a RESTFul web service which is not hosted in IIS

  

I have created a WCF RESTFul webservice by following http://msdn.microsoft.com/en-us/library/dd203052.aspx. I am hosting my RESTful webservice in a window service (and not IIS) using the WebServiceHost class. 

Now I am struggling to get user's windows credentials in my web service methods. I looked at various code samples in forums for this. Almost all of them are hosting the service in IIS plus configuring  the service's settings using <system.serviceModel> tag.

I don't want to host my service in IIS plus as of now I haven't overridden any EndPoints, Behaviours etc in .config file.

I tried with below code in my window service's onstart method

WebServiceHost host = new WebServiceHost(typeof(MyService), new Uri(_serviceUrl));

ServiceAuthorizationBehavior myServiceBehavior = host.Description.Behaviors.Find<ServiceAuthorizationBehavior>();
           
myServiceBehavior.PrincipalPermissionMode = PrincipalPermissionMode.UseWindowsGroups;

host.Open()

After putting above code I queried ServiceSecurityContext.Current and System.Threading.Thread.CurrentPrincipal  my RESTFul's method but they are showing no sign of return

WCF service hosted in a Windows Service Automatically Starting

  

I stop the Windows service that hosts the WCF application, it stops, then it starts back up. Service recovery options are disabled.

 

It is somehow starting itself back up…   Any ideas as to why?


Kevin Burton

MSMQ Recieve Activty fails in workflow hosted in Windows Service

  

Hello,

I am trying to implement a windows service hosted workflow service that polls from a message queue. The message queue is is populated by a separate windows service.

I followed the post below for my hosted workflow as it looked to be close to what I was trying to do.

http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/aa2cee8c-8c7b-40d2-9b7a-0760aa556ebe

Following the steps in the post I was able to get my service to work when the message body was a simple string and using the WCFTestClient.

I then changed the code to use a a custom .NET object as the Recieve parameter instead of the string. The class library in which the object is defined was added as a reference. The service that populates my queue uses the custom .NET object as the message body.

In this scenario, the service would run but only process a message from the queue if it was in the queue before the service started. Any new messages added are ignored and if I add the message after I start the queue it also does not get picked up.

My xamlx is below, followed by my app.config:

xamlx:

<Wo

WCF REST webservice hosted in a windows service

  

Hi, I created a WCF REST service which had a method "Result":

 

[ServiceContract]

public interface IService

{

   [OperationContract(Name =  "Result")]

   [WebGet(UriTemplate = "/")]

   string Result();

}

When I went to the default page http://localhost:portnumber/Service.svc it would display the string returned by Result().

 

I then wanted to host the WCF service in a Windows Service. The service is running fine and I can browse to the baseAddress. However in this setup it displays the default "You have created a service" page and doesn't execute the method returning the string.

 

I'm not even sure if this is possible. In summary is it possible to how a WCF REST service in a Windows Service and get it to respond to HTTP GET requests?

 

Can anybody suggest a solution?

 

Thanks!

 

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend