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
79
votes
3 answers

What is "mexHttpBinding"?

What is "mexHttpBinding" in WCF? When should this binding be used in preference to other bindings?
Craig Schwarze
  • 11,367
  • 15
  • 60
  • 80
78
votes
11 answers

Content Type text/xml; charset=utf-8 was not supported by service

I have a problem with a WCF service. I have a console application and I need to consume the service without using app.config, so I had to set the endpoint, etc. by code. I do have a service reference to the svc, but I can't use the…
user1055483
  • 853
  • 3
  • 8
  • 6
78
votes
22 answers

WCF, Service attribute value in the ServiceHost directive could not be found

I'm trying to host my service with IIS 6 but I keep get this exception. Server Error in '/WebServices' Application. -------------------------------------------------------------------------------- The type…
nandarya
  • 863
  • 1
  • 6
  • 12
77
votes
22 answers

WCF gives an unsecured or incorrectly secured fault error

I am trying to consume a remote svc web service. I created the proxy class using svcutil.exe, and after that I've added that class to my console application, but it yields an error: An unsecured error or incorrectly secured fault was received from…
user179862
  • 771
  • 1
  • 5
  • 3
77
votes
10 answers

WCFTestClient The HTTP request is unauthorized with client authentication scheme 'Anonymous'

I've created one WCF service and deployed it on Server. When I browse this service it gives me positive response with ?wsdl URL. Now I'm trying to test the service through WCF Test client. It shows proper metadata. But when I try to invoke any of…
user82613
  • 1,323
  • 2
  • 12
  • 17
76
votes
3 answers

Why method overloading is not allowed in WCF?

Assume that this is a ServiceContract [ServiceContract] public interface MyService { [OperationContract] int Sum(int x, int y); [OperationContract] int Sum(double x, double y); } Method overloading is allowed in C#, but WCF does…
Sleiman Jneidi
  • 22,907
  • 14
  • 56
  • 77
75
votes
9 answers

Large WCF web service request failing with (400) HTTP Bad Request

I've encountered this apparently common problem and have been unable to resolve it. If I call my WCF web service with a relatively small number of items in an array parameter (I've tested up to 50), everything is fine. However if I call the web…
Damovisa
  • 19,213
  • 14
  • 66
  • 88
75
votes
2 answers

How to programmatically connect a client to a WCF service?

I'm trying to connect an application (the client) to an exposed WCF service, but not through the application configuration file, but in code. How should I go about doing this?
Alex
  • 7,432
  • 20
  • 75
  • 118
75
votes
2 answers

Set IncludeExceptionDetailInFaults to true in code for WCF

How do I set IncludeExceptionDetailInFaults in code without using App.Config?
Josh
  • 13,530
  • 29
  • 114
  • 159
73
votes
9 answers

How can I get rid of the "The target assembly contains no service types" error message in VS2008?

I've got a Client/Server wcf application My executable doesn't define any ServiceContract, it doesn't even have a reference to System.ServiceModel (but instead has a reference to an assembly which contains the connection logic to the server) I've…
Brann
  • 31,689
  • 32
  • 113
  • 162
72
votes
4 answers

Can I pass non-string to WCF RESTful service using UriTemplate?

Can I do the following? [OperationContract] [WebGet(UriTemplate = "/foo/{id}")] string GetFoo(int id); I'd like my service to function as both RESTful service and RPC-style SOAP service. If possible I'd like to retain int as int, and not do parsing…
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
71
votes
3 answers

Purpose of ClientSettingsProvider.ServiceUri in app.config

What does do? Since the value is empty string, can I remove the element?
linquize
  • 19,828
  • 10
  • 59
  • 83
70
votes
7 answers

How to get working path of a wcf application?

I want to get the working folder of a WCF application. How can I get it? If I try HttpContext.Current.Request.MapPath(HttpContext.Current.Request.ApplicationPath) I get a null reference exception (the Http.Current object is null). What I meant…
Stefan Filip
  • 1,791
  • 3
  • 15
  • 25
69
votes
4 answers

What is the relationship between WCF, Rest and SOAP?

What is the relationship between WCF and REST&SOAP? Is WCF based on one of those technologies (REST or SOAP) or it is a separate technology?
user1460819
  • 2,052
  • 5
  • 26
  • 35
66
votes
5 answers

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…
DavidWhitney
  • 4,290
  • 4
  • 24
  • 30