wcf

Assembly reference not resolving in the Web.config

I am developing WCF service hosted by IIS. I need to add KnownType attribute to my base class. One way of adding KnownType attribute is to add a section into the Web.config file like this: <system.runtime.serialization> <dataContractSerializer> <declaredTypes> <add type="MyBase, MyBaseDll"> <knownType type="MyDerived, MyDeri...

How can I customize WCF client code generation?

Are there any tools or code generation templates that will let me customize and extend the WCF cliend proxies? It's not that svcutil is horribly broken, but rather I'd like to be able to generatate additional code based on the service contract, not just be limited the svcutil output. ...

Running REST/WCF as STA instead of MTA for COM

Is it possible to configure a REST (WCF) service to run as STA instead of MTA? This is approach is needed in order to run legacy COM objects. In order to configure ASMX web services to run as STA instead of MTA, there is a workaround available that uses an HTTPHandler to force the web service to run as STA. An article by Jeff Prosise ...

IsReference property in data contract

What is the purpose of IsReference property in Data contract. How the request and response vary with these property./ ...

Consuming a Restful WCF Service with Ruby ActiveResource

I'm trying to consume a RESTful WCF service in a Rails app using ActiveResource. My ActiveResource class is: class PartReferenceService < ActiveResource::Base self.site = "http://localhost:1234/" end The WCF URL is http://localhost:1234/PartReferenceService.svc/ and it returns XML like: <ArrayOfReferenceDataModel xmlns="http...

What is the accepted pattern for an application that can be run as a service or as a console application

I have a project that is deployed to production as a windows service. However for local development purposes it would be useful to run it as a console application. At the moment I have a class Called ReportingHost that provides my core functionality, And a class called ReportingServiceHost that inherits from ServiceBase and allows me to ...

What is the lifecycle of an IIS-hosted (http) WCF service?

I have a dependency injection container setup in my application and I'm thinking that composing the container every time a WCF service request comes in is going to be inefficient. Can somebody explain to me, for an http/IIS hosted WCF service, what the lifecycle of the service is? If I can figure this out, I can make an educated decisio...

Keep MEX binding insecure while securing HTTP binding w/ UsernamePasswordValidator?

We're using UsernamePasswordValidator along with a certificate to secure access to our WCF services. However, the custom authorization policies we're using are SERVICE behaviors, not endpoint behaviors, so they apply to all endpoints, including the MEX endpoint. We'd like to be able to go and grab the service references using visual st...

Best practice to handle large WCF service

I'm working on a 4-player network game in WPF and learning WCF in the process. So far, to handle the network communication, I've followed the advice from the YeahTrivia game on Coding4Fun game: I use a dualHttpBinding, and have use a CallbackContract interface to send back messages to clients. It works pretty well. However, my service i...

WCF - Cannot resolve [WebGet] symbol - what am I doing wrong?

I am working on a REST WCF project and when I implement the following code, it complains that it can't resolve the WebGet class? What am I missing? I tried importing the System.ServiceModel.Web namespace but it can't find it even though I referenced it. The "Web" in System.ServiceModel.Web does not register when I register it in a usi...

Sockets Vs. WCF

Hello, I work on a chat-like application, where I use Silverlight on the client side and wpf on the server side. Right now the communication is based on Sockets: I have different Message-Classes which I serialize and send via TCP. I start realizing that creating a seperate Message Class for each possibile communication scenario is quit...

How can i get the WindowsIdentity or WindowsPrincipal of a WCF Claim / SecurityIdentifier (SID)?

I'm trying to allow all users in the Administrators group access through WCF. internal sealed class AuthorizationManager : ServiceAuthorizationManager { public override bool CheckAccess(OperationContext operationContext) { base.CheckAccess(operationContext); ReadOnlyCollection<ClaimSet> claimSets = operationContext.Se...

How do I return an interface from a WCF Service?

Lets say I have some interfaces: public interface IFoo { IBar DoesStuff(); } public interface IBar { string Thingo { get; } } I'm consuming this code throughout my code base. The IFoo process needs to be moved onto a different system (a difference of x64 vs x32), this is our reason for using WFC. My WCF service implements this int...

WCF Session problem

Hi all, I'm new to WCF and have not much idea. By using a sample code I tried WCF through remoting... It works fine for few min but if i leave the client without accessing the WCF server I get an exception like this.... Exception:Unable to connect to the remote server. Inner Exception : System.Net.Sockets.SocketException: A connecti...

WCF DAL for ORACLE:150+ users

Hi , I am trying to build a DAL for Oracle using WCF.My Application is on intranet,So i choose to go for tcp binding which is supposed to be fastest. My requirment is simple. My DAL exposes function which returns dataset based on query/sp. Initially we used webservice and everything was fine except timeout problems. Some of the SP reque...

The right way to create WCF service references?

Hi All, I have a self hosted TCP based WCF service. I am now building a project that consumes that service, but there seems to be at least two ways of adding a service reference to a project and the both produce wildly different proxies. First I used the "Add service reference" from the project menu, but this generated quite a few files...

What steps do I need to take to use WCF Callbacks?

I am trying to learn WCF. I have a simple client and server application setup and upon pressing a button on the client, it gets an updated value from the server. My next step is I am trying to do a callback from the server to the client to update its value. I have poured through many examples, and they just seem too big and confusin...

Converting Web Service to WCF

I recently wrote a wrapper (C#) for an ApplinX web service - this is a product that is part of the Software AG Adabas offering. The web service interface is really primitive and I wrote the wrapper to make it easier to use. The wrapper is in use on web applications (C# + Asp.Net) but I want to a Windows client to access it using WCF. Wo...

How can I invoke a WCF operation without HTTP container?

I have an environment in which I cannot add another HTTP container (whether ServiceHost, IIS, etc.) but I still need to process SOAP requests (represented as strings) with a WCF web service. I was hoping to write a simple wrapper method (C#) such as: string processSoapMessage(string req); In that method, I would manually create a Sys...

Contract-First SOA with WCF

Hello StackOverflow gurus! This question is more of a probe to discover what people are doing in the community, in practical situations, than a specifically targeted question. I have searched pretty broadly about this, and while I have found a lot of bloggers advocating contract-first service design and some comments backing them up, I h...