servicehost

Custom ServiceHost in wcf configuration file?

hi there, i wonder if there is a way to specifiy a custom ServiceHost (i.e. a ServiceHost derived class) in configuration? thanks ...

WCF ServiceHost basicHttpBinding 503 error

Hi all, I'm trying to run a WCF ServiceHost as an NT Service on a Windows 2007 SP1 Server. The ServiceHost is reponsible for hosting a single service endpoint: a basicHttpBinding with the following address: http://localhost:5555/ToBlah When I run this ServiceHost on my local machine (Windows XP), it works fine - when I POST a SOAP ...

WCF: Duplex Callback always Anonymous

I've written a WCF duplex service and client. Everything works well until I try to call .Demand() in the client implementation. It appears that the the service invokes the callback method Anonymously. I think I am missing how to correctly configure the service. Code used to create ServiceHost; ServiceHost duplex = new ServiceHost(ne...

WCF Service - runtime not seeing the ServiceContract on Interface

I'm new to WCF and trying to get my first service running. I'm close but stuck on this problem. In my interface definition file, I have this: [ServiceContract(Namespace="http://mysite.com/wcfservices/2009/02")] public interface IInventoryService { [OperationContract] string GetInventoryName(int InventoryI...

using custom principal in Workflow

I have an application that hosts several WCF services. I have created a custom ServiceAuthorizationManager that is working perfectly. I inspect a few elements on the OperationContext.IncomingMessageHeaders to get a username and password. This was to overcome some limitations in our environment that wouldnt allow us to use what was bui...

WCF: What is a ServiceHost ?

As I'm currently learning to use WCF Services, I am constantly encountering tutorials on the internet which mention using a ServiceHost when using a WCF Service. What exactly is this ServiceHost ? In my current project I am using a WCF Service and having a reference to it from my app and whenever I want to consume it from my app I ...

WCF:: ServiceHost: Oddity...Still alive even if thread is dead?

Hello, a new member here. Nice to see such a neat community. After a bit of research, I decided to use WCF in my application to do inter process communication, so I am using the NetNamedPipeBinding binding. The ServiceHost hosting application is not a dedicated server, so it has to spawn the ServiceHost via a thread. So far so good. S...

WCF:: ServiceHost & AddServiceEndpoint: Are Arguments types reversed?

While I am trying to learn WCF, and it seems straight-forward enough, I came through an odd situation...at least it seems odd to me. Why is it that the ServiceHost ctor takes a concrete class, and the AddServiceEndpoint takes the Interface, and not vice versa? it seems the latter is more logical from an OOP standpoint. Consider the fol...

How does one set up a WCF ServiceHost within a Windows Service that can access stateful information within the Windows Service.

I have a written a Windows Service in C#. It is functioning and performing well. I have added a WCF service to the Windows service to enable client applications to connect to the Windows service and obtain stateful information from the Windows service. I configured the WCF service to be a singleton, so that the same service instance is...

Can two applications share same WCF NetTcpBinding port if they use different end point addresses?

I have a Client and Server scenario, where a service is installed on the client and another service on the server. I have no issues when these are installed on different machines. However, I would like to also be able to install both the Client service and Server service on the same machine. I could set them up to use different ports, ho...

ServiceHost message receive event?

Surely there must be an event to attach onto before a ServiceHost or Channel or Dispatcher handles a message? I'm assuming it can be accessed through OperationContext.Current, but the closest events I can find are Opening and Closing. Is there something like a MessageReceived or BeforeMessageProcessed event? If not using events, is the...

ServiceHost's conflict on address when unit tested

I have a small WCF hosting engine that I am writing that will dynamically create ServiceHosts based on the .config file. The general idea is to allow us to remove existing services, as well as add new services, at runtime without having to bring all of our services offline. I ran into a problem unit testing that indicates this may not b...

Joining threads in a WCF hosted service

Can anyone recommend a "clean" way of closing a WCF service and its threads when hosted in a servicehost object? Calling servicehost.Close(); doesn't work when the service has spawned other threads :/ Cheers, Rob ...

Win32Exception @ ServiceHost.Open() for WCF service...

I am working on writing BDD specifications for a broad set of WCF service infrastructure I am writing. I have noticed that each specification I write that involves a call to ServiceHost.Open(), that line takes a good 2 - 6 seconds to execute (the time keeps growing as I add more and more specs). I noticed that when this method is called,...

Creating a WCF ServiceHost object takes three to four minutes on some PCs

Hello, I have created a WCF service which does not use the app.config to configure itself. However, it takes three to four minutes on some PCs to construct the ServiceHost object. Thinking there was something wrong with my service, I constructed a simple Hello, World service and tried it with that. I have the same issue. According to t...

WCF - Closing a duplex ServiceHost blocks for CloseTimeout duration if closed when client(s) connected

I have a Windows Service that hosts three different duplex WCF channels. Clients can connect to have updates sent to them via their callback contract. Essentially there are three pub-sub channels. This service takes a long time to bounce when clients are connected. The call to ServiceHost.Close takes 10 seconds to return (so the serv...

Can AppDomainSetup.ConfigurationFile be loaded from database?

I'm working on a WCF host by using ServiceHost and dynamically creating several application domains to keep my services up. I'm also planning to keep my assemblies on database and load them by using Assembly.Load(byte[]) But now I stumbled on a problem: how to load my configuration file (aka *.dll.config) from database and pass it to my...

What are the benefits for several servicehosts? Does one ServiceHost support several simultaneous connections on one endpoint?

I'm thinking of self-hosting my WCF service instead of using IIS. A big question for me is whether I need to instantiate multiple servicehosts as IIS does or one wil be enough. Do muptiple servicehosts give any benefit except security reasons dut to isolation? Can one servicehost serve multiple connections on one endpoint simultaneou...

Castle WCF DefaultServiceHostFactory in IIS: Accessing the ServiceHost

I am attempting to move from a self hosting architecture to hosting under IIS 6, primarily to take advantage of built in dynamic compression. I am using the Castle DefaultServiceHostFactory to provide the service to IIS in the .svc file. However, I need to programmatically specify certain end points and behaviours and I do not know how...

WCF Service worker thread communicate with ServiceHost thread

I have a windows NT Service that opens a ServiceHost object. The service host context is per-session so for each client a new worker thread is created. What I am trying to do is have each worker thread make calls to the thread that started the service host. The NT Service needs to open a VPN connection and poll information from a devic...