+ Start a Discussion
Bill Bell 3Bill Bell 3 

SOAP C# Example

I am experimenting with creating a SOAP connection to Salesforce using C#.  I am using the sample code in SOAP API Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm) (PDF pages 22-28).  It says it uses "A .NET 3.0 style reference uses services like SoapClient".  Can someone explain how to setup a Service Reference to a SoapClient.  Everywhere it mentions SoapClient it is giving me an error.  I've looked for hours on how to do this.  I added a Service Reference to the WSDL file and that worked.  Thanks.


Code:
using System;
using System.ServiceModel;
using SimpleConnect.SFProd;  // WSDL XML File

namespace SimpleConnect
{
    class SimpleConnect
    {
        private static SoapClient loginClient; // for login endpoint  ****************** error
        private static SoapClient client; // for API endpoint     *********************error

Using VS Community 2015 and .net 4.5.2