Consuming an ASMX Web Service from a WCF client

As a unified distributed communication platform, WCF can help developers build standard SOAP XML-based Web Services so that traditional XML Web Service clients can consume it. Likewise, it is also quite convenient to use WCF-based client applications for consuming traditional XML Web Services.

In this recipe, we will show you how to consume a traditional ASMX Web Service from a WCF-based client application.

How to do it...

We will use a simple ASMX Web Service as an example here. The complete steps for consuming the sample service are as follows:

  1. Create the sample ASMX Web Service.

    The sample ASMX Web Service contains a single operation that returns some string data. The complete definition of the ...

Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.