O'Reilly logo

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications by Steven Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing a WCF service via the WebRequest component

Sometimes, it is required that our WCF service be called by some client platform which can only issue plain HTTP GET/POST requests. Or, in .NET framework-based applications, we sometimes might need to use WebRequest components (under the System.Net namespace) to consume XML Web Services or WCF services.

In this recipe, we will demonstrate how to use a .NET WebRequest component to consume an HTTP-based WCF service.

How to do it...

Here we will use a HttpWebRequest component to retrieve some simple text data from a standard WCF service application. Let's take a look at the steps to achieve this:

  1. Set up the WCF service application.

    The sample service here is a very simple one that contains one operation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required