How to Pass Windows Credentials along with Basic Credentials to WCF service

Last Reply 15 days ago By dharmendr

Posted 19 days ago


When I try to consume a WCF service which needs Basic credentials, it was giving me error as "there was no end point....", but with help of this post " There+was+no+endpoint+listening+at+https+ABC+redf+gov+sa+RedfFinance+Finance+svc+RedfFinance+that+could+accept+the+message+  "

I discussed with our n/w security team and set the proxy in the web.config and it worked, but it is not working in another computer. For that my n/w security team is asking me to pass my windows credentials before making call to WCF service, I am bit confused I am already passing 2 types of credentials 1. Basic 2. For each method. So kindly help me , how to pass the windows credentials before making call to WCF service, below is my code. Thanks.

ServiceReference1.FinanceClient objFinanceClient = new ServiceReference1.FinanceClient();
                objFinanceClient.ClientCredentials.UserName.UserName = "abc";
                objFinanceClient.ClientCredentials.UserName.Password = "123456";
                ServiceReference1.Credential objCredentials = new ServiceReference1.Credential();
                objCredentials.UserName = "xyz";
                objCredentials.Password = "123456";
                var Response = objFinanceClient.getRealEstateRegions(objCredentials);
                lblDisplay.Text = Response.RealEstateRegionResponse.ToString();

                <binding name="WSHttpBinding_IFinance" proxyAddress="" bypassProxyOnLocal="false" useDefaultWebProxy="false">
                    <security mode="Transport">
                        <transport clientCredentialType="Basic" />
            <endpoint address=""
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IFinance"
                contract="ServiceReference1.IFinance" name="WSHttpBinding_IFinance">
                    <dns value="" />


You are viewing reply posted by: dharmendr 15 days ago.