binding : wsHttpBinding
security mode: Message
Client Credentials : Username
Server certificate : yes
I know how to consume from Desktop app. like...
ServiceReference1.Service1Client jc = new ServiceReference1.Service1Client ();
jc.ClientCredentials.UserName.UserName = "a";
jc.ClientCredentials.UserName.Password = "a";
jc.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
Console.WriteLine(jc.GetData());
but want to know how to cosume from asp.net or MVC web app????
Thanks...
Consume WCF wsHttpBinding/message/username service from asp.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Keyur PatelRank #1,216 · 1.5K reputationPosted May 15, 2013, 11:30 PM EDT
Once you create service client object as proxy then you can pass your username, password,certificatevalidationmode. You can consume your WCF service in MVC as in following sample. You can refer following URL.
http://msdn.microsoft.com/en-us/library/ff648840.aspx
http://blog.adnanmasood.com/2010/04/29/step-by-step-guide-for-authenticating-wcf-service-with-username-and-password-over-ssl/
http://www.codeproject.com/KB/aspnet/aspnetmvc_bugtracker_v4.aspx
=====================================
public ActionResult About()
{
ServiceReference1.Service1Client proxy = new ServiceReference1.Service1Client();
ViewData["result"] = proxy.GetData(4);
return View(ViewData);
}
hj hj4 reputationPosted May 16, 2013, 12:26 AM EDT