I have a SharePoint site that makes calls to a public web API (Melissa Data) using a WCF client. I have the endpoints configured in the web.config like so:

            <binding name="PropertyWSSOAPEndpoint">
                <security mode="Transport" />
        <endpoint address="https://property.melissadata.net/v3/SOAP/Service.svc"
            binding="basicHttpBinding" bindingConfiguration="PropertyWSSOAPEndpoint"
            contract="MelissaDataPropertyService.IService" name="PropertyWSSOAPEndpoint" />

I instantiate my client like so:

MelissaDataPropertyService.ServiceClient PropertyServiceClient = new MelissaDataPropertyService.ServiceClient();

This all works fine and dandy, but I've heard it is bad practice to put site configuration values into the SharePoint IIS web.config. Can someone please explain to me a.) why this is a bad practice, and b.) how to configure and instantiate the WCF client object without using the web.config?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.