WCF asynchronous client proxy and asynchronous service operations

In this post, we will cover asynchronous operations with our WCF proxy and our WCF service.
All by all, this is not any rocket science, but in my attempt to master WCF basics it is one of the topics I will cover.

As usual, we start with a basic solution setup:

WCF Asynchrony solution overview

WCF.Asynchrony.Client: Console application used as client
WCF.Asynchrony.Service: WCF Service application with 1 WCF service named “Public”

Continue reading

WCF message headers with OperationContext and with MessageInspector and Custom Service Behavior

In this post we will view some possible options for adding message headers to the messages send from the client to service.

Our scenario:

We have a WCF service provided as a Software as a Service (SaaS). People who have an active subscription with our company, are able to invoke methods on our service and retrieve information. To successfully invoke methods and retrieve information the client invoking the method must add a message header named “SubscriptionID which contains the subscriptionid of that customer. If the subscriptionid does not match a valid and active subscriptionid, access to the operations are denied.

1. Setup and configuration of the Service

Our solution setup looks as following:
Solution overview

The “WCF.MessageHeaders.Client” is a Console Application used to mimic a client
The “WCF.MessageHeaders.Service” is a WCF Service Application, holding our SaasService

Continue reading

WCF message security and client certificate authentication with self-signed certificates

For setting up the WCF message security with client certificate authentication, we will start from what we build at the previous post

WCF Transport Security and client certificate authentication with self-signed certificates

I suggest you read the previous post if you have not, as it handles some things about self-signed certificates, certificate mmc and IIS configuration. I will not repeat those things in this post. If you need them, you can read through the post mentioned above.

This was the solution overview we created in the previous post:

Solution overview

We will continue from what we created there, and make some very small changes to move from Transport Security to Message Security.
In the previous post where we set up Transport Security, we used basicHttpBinding. For this example I will move from basicHttpBinding to wsHttpBinding.
The reason for this decision you can see at section 3. NegiotiateServiceCredential

Having stated the above, let’s make the necessary changes to our solution of the Transport Security WCF Service.

Continue reading

WCF transport security and client certificate authentication with self-signed certificates

I have only recently got into contact with Windows Communication Foundation (WCF). As a newbie, one of the things I struggled with at first was securing a WCF service with self-signed certificates. Never having used certificates and not knowing how it actually works, it was challenging task to say the least. Looking back now it makes me feel a little silly …

For this post we will use a common business-2-business scenario. We will create a transport-secured (HTTPS) WCF service with certificate client-credential authentication.

1. Create the solution setup:

For this scenario, we will build a solution called “WCF.Tutorial.TransportSecurity”

Solution overview

There are 2 projects in this solution: (both are default template projects)

  1. WCF Service Application called “WCF.Tutorial.TransportSecurity.Service” 
  2. Client console application called “WCF.Tutorial.TransportSecurity.Client”