Using a WCF Service in Microsoft Office
One interesting and useful interoperate scenario of WCF service development is how to consume a WCF service from a Microsoft Office client such as Word, Excel, or Outlook. Currently, there are several possible solutions for WCF service consumption in an Office client, which include:
Creating a .NET client proxy and exposing it as a COM object
Using the XML HTTP component to consume the WCF service over plain HTTP in VBA code
Directly using VSTO and .NET-managed code to consume WCF services
In this recipe, we will demonstrate a different approach for consuming a simple WCF service in a Microsoft Office client, which utilizes the WCF service moniker component.
How to do it...
The sample service here will use Office Excel as an example to demonstrate the client-side service-consuming ability in Microsoft Office. Let's take a look at the detailed steps to build the sample application:
Create a sample WCF service.
As Office clients do not have a rich .NET object...