wcf

WCF - High availability

Is there anyway to configure a WCF service with a failover endpoint if the primary endpoint dies? Kind of like being able to specify a failover server in a SQL cluster... Specifically I am using the TCP/IP binding for speed, but on the rare occurrence that the machine is not available I would like to redirect traffic to the failover ser...

C# WCF Service - Backward compatibility issue

I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (which I believe is required for...

Web Services -- WCF vs. Standard

Working on a new project and was wondering was there any benefit with going with a WCF web service over a regular old fashion web service. Visual Studio offers templates for both. What are the differences? Pros / Cons? ...

Best Practices for securing a REST API / web service

When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ? When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST endpoints. While I understand ...

WCF Backward Compatibility Issue

I have a WCF service that I have to reference from a .net 2.0 project. I have tried to reference it using the "add web reference" method but it messes up the params. For example, I have a method in the service that expects a char[] to be passed in, but when I add the web reference, the method expects an int[]. So then I tried to setup ...

What is the easiest way to add compression to WCF in Silverlight?

I have a silverlight 2 beta 2 application that accesses a WCF web service. Because of this, it currently can only use basicHttp binding. The webservice will return fairly large amounts of XML data. This seems fairly wasteful from a bandwidth usage standpoint as the response, if zipped, would be smaller by a factor of 5 (I actually pas...

.Net - Returning DataTables in WCF

I have a WCF service from which I want to return a DataTable. I know that this is often a highly debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment. When I create a DataTable from scratch, as below, there are no problems whatsoever. The table is created, populated, and r...

Good Reads for Distributed Systems

I am working on a server system that going to have a distributed architecture. Can anyone recommend some good (titles|urls|blogs) on programming distributed architectures, P2P, Master/Slave, etc..? It will be implemented in WCF. ...

What's the best way to authenticate over WCF?

What's the best way to implement authentication over WCF? I'd prefer to not use WS-* as it needs to be transport independant. Should I "roll my own"? Is there any guidance for doing that (articles/blog posts)? Or is there some way to (and should I) use the built in ASP.NET Membership and Profile providers on the server side? ...

I would like some tips for debugging WCF Web Service exceptions

I've created a WCF service and when I browse to the endpoint I get the following fault: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none"&gt; a:ActionNotSupported </faultcode> <faultstrin...

Loading System.ServiceModel configuration section using ConfigurationManager

Using C# .NET 3.5 and WCF, I'm trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to). The obvious way is to use ConfigurationManager to load the configuration section and write out the data I need. var serviceModelSection = ConfigurationManager.GetSection("sys...

WCF push to client through firewall?

See also How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Coment or long polling) I need to use push-technology with WCF through client firewalls. This must be a common problem, and I know for a fact it works in theory (see links below), but I have failed to get it working, an...

What WCF best practices do you follow in object model design?

Hi all, I've noticed that a handful of WCF applications choose to "break" their objects apart; that is, a project might have a DataObjects assembly that contains DataContracts/Members in addition to a meaningful class library that performs business logic. Is this an unnecessary level of abstraction? Is there any inherent evil associate...

Closing and Disposing a WCF Service

The Close method on an ICommunicationObject can throw two types of exceptions as MSDN outlines here. I understand why the Close method can throw those exceptions, but what I don't understand is why the Dispose method on a service proxy calls the Close method without a try around it. Isn't your Dispose method the one place where you want ...

InvalidOperationException while creating wcf web service instance

I have a WCF Web Service which is referenced from a class library. After the project is run, when creating the service client object from inside a class library, I receive an InvalidOperationException with message: Could not find default endpoint element that references contract 'MyServiceReference.IMyService' in the ServiceModel client...

WCF - Domain Objects and IExtensibleDataObject

Typical scenario. We use old-school XML Web Services internally for communicating between a server farm and several distributed and local clients. No third parties involved, only our own applications used by ourselves and our customers. We're currently pondering moving from XML WS to a WCF/object-based model and have been experimenting ...

How can I authenticate using client credentials in WCF just once?

What is the best approach to make sure you only need to authenticate once when using an API built on WCF? My current bindings and behaviors are listed below <bindings> <wsHttpBinding> <binding name="wsHttp"> <security mode="TransportWithMessageCredential"> <transport/> <message clientCredentialType="UserName" negoti...

How many ServiceContracts can a WCF Service have?

Specifically, since a ServiceContract is an Attribute to an Interface, how many interfaces can I code into one WCF web service? Is it a one-to-one? Does it make sense to separate the contracts across multiple web services? ...

Lazy Loading with a WCF Service Domain Model?

I'm looking to push my domain model into a WCF Service API and wanted to get some thoughts on lazy loading techniques with this type of setup. Any suggestions when taking this approach? ...

Best practices for versioning your services with WCF?

I'm starting to work with my model almost exclusively in WCF and wanted to get some practical approaches to versioning these services over time. Can anyone point me in the right direction? ...