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
11
votes
1 answer

Why does adding httpRuntime targetFramework in Web.config file in a WCF application resolving TLS related connectivity issue?

We have a few ASP.NET and WCF applications that are continuously being migrated to latest .net framework version as it is being released. This migration was working fine until we reached .NET Framework 4.6.2 and since then we started seeing TLS…
sethu
  • 229
  • 1
  • 3
  • 12
11
votes
3 answers

WCF Tracing in ASP.NET Core

We used to use WCF over ASP.NET and recently switched to WCF over ASP.NET Core. This was quite hard to implement because ASP.Net Core doesn't support WCF out of the box. For one thing, the whole web.config XML configuration model has been dumped in…
Christian Findlay
  • 6,770
  • 5
  • 51
  • 103
11
votes
5 answers

Why does .net WCF Service require the Interface

Unlike the asmx implementation the wcf requires for you to implement it's interface. I do not quite understand the reason behind that design. Interface is a contract between 2 classes...With that being said, how often do you have 2 wcf services that…
dexter
  • 7,063
  • 9
  • 54
  • 71
11
votes
1 answer

AggregateException "One or more errors occurred.An error occurred while sending the request."

I tried to post a file to an API rest from my WCF .Net framework 4.5. Here is my code: public string CreateConclusion(string[] instanceUIDs) { var root = @"C:\"; string filename =…
Viet Nguyen
  • 113
  • 1
  • 1
  • 5
11
votes
2 answers

WCF Client consuming WS-Security webservice

I managed to consume a java based web service (third party) with WS-Security 1.1 protocol. The web service needs only to be signed over a x509 certificate, not encrypted. But I'm getting this error: The signature confirmation elements cannot occur…
Gonzalo Lorieto
  • 635
  • 6
  • 24
11
votes
3 answers

Combined JAX-RS and JAX-WS

Is there a framework, library or technique that combines JAX-RS and JAX-WS (or equivalent functionality) into one combined service in a similar way to using two endpoints (one SOAP and one REST) for the same service in WCF?
Kynth
  • 2,597
  • 1
  • 18
  • 24
11
votes
1 answer

AspNetCompatibilityRequirements causes WCF web service to block

Hello I have a simple wcf service like this, with a test method which simply sleeps for 20 seconds and returns a value. I wrote a test page which uses jquery to call it 10 times in a row, and it appears to execute concurrently, with the client…
Tuviah
  • 723
  • 2
  • 10
  • 20
11
votes
2 answers

The InstanceContext provide to the ChannelFactory contains a UserObject that does not implement the CallbackContractType

I'm trying to get WCF duplex communication working an I'm struggling as I keep getting the error: The InstanceContext provide to the ChannelFactory contains a UserObject that does not implement the CallbackContractType" I know there are other…
user589195
  • 4,180
  • 13
  • 53
  • 81
11
votes
3 answers

session-per-request implementation for WCF, NHibernate, and Ninject

I am trying to implement a session-per-request model in my WCF application, and I have read countless documents on this topic, but looks like there is not a complete demonstration of this. I actually came across some very useful articles such as…
salimaabey
  • 113
  • 1
  • 6
11
votes
3 answers

How to add maxItemsInObjectGraph programmatically without using configuration file?

I have create a EndpointAddress like that EndpointAddress address = new EndpointAddress("http://example.com/services/OrderService.svc"); But I could not add the Behavior to this Endpoint programmatically. The behavior is given below.:
11
votes
2 answers

WCF sessions with a wsHttpBinding and without windows security

I need to create a WCF service that is hosted in IIS, uses http transport and hold state in the server’s memory. While I’m aware that stateful services aren't a good idea, this last constrain is necessary to make the service work with a legacy…
Robert
  • 6,407
  • 2
  • 34
  • 41
11
votes
4 answers

What is best-practice when designing SOA WCF web-services?

Given an operation contract such as: [OperationContract] void Operation(string param1, string param2, int param3); This could be redesigned to: [MessageContract] public class OperationRequest { [MessageBodyMember] public string Param1 {…
Victor
  • 1,627
  • 2
  • 12
  • 16
11
votes
4 answers

WCF much slower than WebAPI running same code

I currently have 2 exposed endpoints. The first is WebAPI (.NET 4.6). The second is WCF (.NET 3.5). They are both capable of performing the same calculation, however the WCF is on average 10 times slower. The calculation code in question is…
Callback Kid
  • 708
  • 5
  • 22
11
votes
3 answers

Does WCF have an equivalent of MVC's [Authorize] attribute?

I want to decorate certain Operation Contracts with an attribute to authorize the caller by custom logic, something like this: [ServiceBehavior] public class Service1 { [OperationContract] [Authorize] // ?? this should make sure only admins…
Dmitry Sadakov
  • 2,128
  • 3
  • 19
  • 34
11
votes
6 answers

File download through WCF slower than through IIS

The following method (in which I hopefully did not make any mistakes while dramatically simplifying it for this post) is working properly and set up using the Streamed transfer mode over the net.tcp protocol. The problem is that the performance is…
Greg Smalter
  • 6,571
  • 9
  • 42
  • 63