Questions tagged [wcf]

Windows Communication Foundation is a part of the .NET Framework that provides a unified programming model for rapidly building service-oriented applications.

According to the Microsoft Developer Center:

Windows Communication Foundation (WCF) is a part of the .NET Framework that provides a unified programming model for rapidly building service-oriented applications that communicate across the web and the enterprise.

WCF Resources

WCF is a tool often used to implement and deploy a service-oriented architecture (SOA). It is designed using service-oriented architecture principles to support distributed computing where services have remote consumers. Clients can consume multiple services; services can be consumed by multiple clients. Services are loosely coupled to each other. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on. WCF implements many advanced Web services (WS) standards such as WS-Addressing, WS-ReliableMessaging and WS-Security. With the release of .NET Framework 4.0, WCF also provides RSS Syndication Services, WS-Discovery, routing and better support for REST services.

The Windows Communication Foundation (or WCF), previously known as "Indigo", is a runtime and a set of APIs in the .NET Framework for building connected, service-oriented applications.

Endpoints

A WCF client connects to WCF service via an endpoint. Each service exposes its contract via one or more endpoints. An endpoint has an address (which is a URL specifying where the endpoint can be accessed) and binding properties that specify how the data will be transferred.

WCF Features

  • Create and consume traditional SOAP-based web services
  • Create and consume services that use the international WS-* standards
  • Create and consume services using other transports:
    • TCP/IP with binary instead of text-based XML
    • Named Pipes
    • Microsoft Message Queue (MSMQ)
  • Host a WCF Service in any application, not just in IIS
  • Host a service in IIS with any transport, not just HTTP/HTTPS
  • Create services based on Windows Workflow Foundation workflows

Important WCF Questions on Stack Overflow

50818 questions
227
votes
11 answers

Nesting await in Parallel.ForEach

In a metro app, I need to execute a number of WCF calls. There are a significant number of calls to be made, so I need to do them in a parallel loop. The problem is that the parallel loop exits before the WCF calls are all complete. How would you…
Darthg8r
  • 12,377
  • 15
  • 63
  • 100
213
votes
7 answers

Post an empty body to REST API via HttpClient

The API I'm trying to call requires a POST with an empty body. I'm using the WCF Web API HttpClient, and I can't find the right code that will post with an empty body. I found references to some HttpContent.CreateEmpty() method, but I don't think…
Ryan Rinaldi
  • 4,119
  • 2
  • 22
  • 22
205
votes
6 answers

Cannot serve WCF services in IIS on Windows 8

When I try to serve a WCF service on IIS in a Windows 8 machine, I get the well known error The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be…
faester
  • 14,886
  • 5
  • 45
  • 56
204
votes
12 answers

HTTP could not register URL http://+:8000/HelloWCF/. Your process does not have access rights to this namespace

I'm a beginner in WCF, but trying to improve my experience. And on the first step I faced the problem. I created the simplest WCF service. The listing of code: (all the code in one file) using System; using System.ServiceModel; namespace…
valecoder
  • 2,055
  • 2
  • 13
  • 7
202
votes
8 answers

When to use DataContract and DataMember attributes?

I am very confused about the DataContract attribute in WCF. As per my knowledge it is used for serializating user defined type like classes. I wrote one class which is exposed at client side like this. [DataContract] public class Contact { …
sam
  • 2,029
  • 2
  • 13
  • 3
190
votes
7 answers

WCF service startup error "This collection already contains an address with scheme http"

I built a web application containing a WCF service contract and a Silverlight control which makes calls to that WCF service. On my development and test servers it works great. When I deploy to our live server and run the application I get an…
Jeremy
  • 44,950
  • 68
  • 206
  • 332
190
votes
17 answers

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. What is this error all about, and how would I go about solving it?
Innova
  • 4,831
  • 21
  • 76
  • 107
189
votes
11 answers

Where can I find WcfTestClient.exe (part of Visual Studio)

The MSDN docs state that I can find the WCF Test Client in: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ but it seems like a lot of stuff is missing from there, including WcfTestClient.exe. What do I need to install?
eran otzap
  • 12,293
  • 20
  • 84
  • 139
186
votes
24 answers

CryptographicException 'Keyset does not exist', but only through WCF

I have some code that makes a call to a third party web service that is secured using X.509 certification. If I call the code directly (using a unit test) it works without any problems. When deployed, this code will be called via a WCF Service. I…
Richard Ev
  • 52,939
  • 59
  • 191
  • 278
184
votes
1 answer

Catch-22 prevents streamed TCP WCF service securable by WIF; ruining my Christmas, mental health

I have a requirement to secure a streamed WCF net.tcp service endpoint using WIF. It should authenticate incoming calls against our token server. The service is streamed because it is designed to transfer large amounts of data n stuff. This…
user1228
175
votes
14 answers

How to add a custom HTTP header to every WCF call?

I have a WCF service that is hosted in a Windows Service. Clients that using this service must pass an identifier every time they're calling service methods (because that identifier is important for what the called method should do). I thought it is…
mrtaikandi
  • 6,753
  • 16
  • 62
  • 93
175
votes
6 answers

Turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server

I have a WCF service that has been working perfectly, and something has changed and I don't know what. I get this exception: System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more…
Trevor
  • 2,186
  • 3
  • 16
  • 18
170
votes
9 answers

WCF ServiceHost access rights

I get the following error when going through the WCF tutorial. HTTP could not register URL http://+:8000/ServiceModelSamples/Service/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for…
Joshua
  • 26,234
  • 22
  • 77
  • 106
169
votes
17 answers

Sometimes adding a WCF Service Reference generates an empty reference.cs

Sometimes adding a WCF Service Reference generates an empty reference.cs and I cannot reference the service anywhere in the project. Has anyone encountered this?
Matt
  • 25,943
  • 66
  • 198
  • 303
166
votes
4 answers

How to turn on WCF tracing?

Update: I have been trying to turn on WCF tracing, but still no success... Below is my lastest update. Do I need a permission to write to the below location?
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406