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
88
votes
24 answers

WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically. However, when I try and call any of the service contracts, I get the…
Dan Ellis
  • 5,537
  • 8
  • 47
  • 73
88
votes
13 answers

What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType"

I created a WCF service library project in my solution, and have service references to this. I use the services from a class library, so I have references from my WPF application project in addition to the class library. Services are set up straight…
stiank81
  • 25,418
  • 43
  • 131
  • 202
87
votes
8 answers

WCF Data Services (OData) Vs ASP.NET Web API

I am designing a distributed application that will consist of RESTful services and a variety of clients (Silverlight, iOS, Windows Phone 7, etc). Right now I'm determining which technology I should use to implement my services, WCF Data Services…
Raymond Saltrelli
  • 4,071
  • 2
  • 33
  • 52
87
votes
6 answers

How to check if a windows service is installed in C#

I've written a Windows Service that exposes a WCF service to a GUI installed on the same machine. When I run the GUI, if I can't connect to the service, I need to know if it's because the service app hasn't been installed yet, or if it's because…
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
86
votes
14 answers

Task<> does not contain a definition for 'GetAwaiter'

Client iGame Channel = new ChannelFactory ( new BasicHttpBinding ( BasicHttpSecurityMode . None ) , new EndpointAddress ( new Uri ( "http://localhost:58597/Game.svc" ) ) ) . CreateChannel ( ); public Task Client (…
Ahmed Ghoneim
  • 6,834
  • 9
  • 49
  • 79
85
votes
4 answers

What is w3wp.exe?

I have a WCF service running under a service user on my local system. Every time I try to debug it is giving me a message Attach Security warning. In Visual Studio, by default (even without attaching), I get this error: Attaching to this process…
katie77
  • 1,797
  • 4
  • 25
  • 43
85
votes
4 answers

What are the downsides to turning off ProxyCreationEnabled for CTP5 of EF code first

The only way that my WCF service can return classes from a code first model is by setting the ProxyCreationEnable to false using the code below. ((IObjectContextAdapter)MyDb).ObjectContext.ContextOptions.ProxyCreationEnable = false; What are the…
Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154
84
votes
8 answers

Generate C# classes from JSON Schema

I'm creating a C# WCF Web Service that return a lot of data in a JSON format. The client is an iPad application that is currently being developped by another team, So I'm working on specifications, without example data. Currently the JSON string is…
Julien N
  • 3,880
  • 4
  • 28
  • 46
84
votes
16 answers

Does WCF raise the bar or just the complexity level?

I understand the value of the three-part service/host/client model offered by WCF. But is it just me or does it seem like WCF took something pretty direct and straightforward (the ASMX model) and made a mess out of it? Is there an alternative to…
rp.
  • 17,483
  • 12
  • 63
  • 79
83
votes
8 answers

Find the next TCP port in .NET

I want to create a new net.tcp://localhost:x/Service endpoint for a WCF service call, with a dynamically assigned new open TCP port. I know that TcpClient will assign a new client side port when I open a connection to a given server. Is there a…
TheSeeker
  • 2,849
  • 5
  • 24
  • 20
82
votes
3 answers

Obtaining client IP address in WCF 3.0

Apparently you can easily obtain a client IP address in WCF 3.5 but not in WCF 3.0. Anyone know how?
Gaz
  • 4,064
  • 3
  • 32
  • 34
82
votes
6 answers

WCF ChannelFactory vs generating proxy

Just wondering under what circumstances would you prefer to generate a proxy from a WCF service when you can just invoke calls using the ChannelFactory? This way you won't have to generate a proxy and worry about regenerating a proxy when the server…
TheWommies
  • 4,922
  • 11
  • 61
  • 79
80
votes
6 answers

SOAP client in .NET - references or examples?

Background: I am creating a webservices site which will provide many types of simple services over SOAP and possibly other protocols too. The goal is to make it easy to do for example conversions, RSS parsing, spam checks and many other types of…
Emil Vikström
  • 90,431
  • 16
  • 141
  • 175
80
votes
2 answers

How does WCF deserialization instantiate objects without calling a constructor?

There is some magic going on with WCF deserialization. How does it instantiate an instance of the data contract type without calling its constructor? For example, consider this data contract: [DataContract] public sealed class CreateMe { …
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
79
votes
5 answers

How to Consume WCF Service with Android

I am creating a server in .NET and a client application for Android. I would like to implement an authentication method which sends username and password to server and a server sends back a session string. I'm not familiar with WCF so I would really…
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286