All notes

Walk through

MSDN: Creating a simple WCF Service in Windows Forms.

  1. Create project of type "WCF Service Library".
  2. Add test codes:
    // IService1.cs
    string GetData(int value);
    // Service1.cs
    public string GetData(int value)
        return string.Format("You entered: {0}", value);
  3. Test the service. Press F5 to run the service. A WCF Test Client form will be displayed.
  4. Add new Project of type "Console application".
  5. In the "Add Service Reference" dialog box, click "Discover".
  6. Click on the added service reference to see its API (including namespaces and functions).
  7. Call the API from console application.

Another method is to add data source, see MSDN: Connect to Data in a Service:

It can also be used to connect to database and do testings.




REM The following command generates client code from a running service or online metadata documents.
svcutil http://service/metadataEndpoint

REM The following command generates client code from local metadata documents.
svcutil *.wsdl *.xsd /language:C#


SO: where is svcutil.exe in windows 7.

Type in the Microsoft Visual Studio Command Prompt: "where svcutil.exe". On my machine it is in: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SvcUtil.exe".

The command promt itself is found in the start menu under "Visual Studio 2015\Visual Studio Tools\Developer Command Prompt for VS2015".