ServiceClient proxy = new ServiceClient(); proxy.ClientCredentials.UserName.UserName = "umais"; proxy.ClientCredentials.UserName.Password = "asghar"; proxy.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None; string reply = proxy.Hello("Umais");
string url = "http://localhost:56779/Service.svc/Hello"; string parameters = "{'Name': 'Umais'}"; HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); req.Method = "POST"; req.ContentLength = 0; req.ContentType = "application/soap+xml; charset=utf-8"; if (!string.IsNullOrEmpty(parameters)) { byte[] byteArray = Encoding.UTF8.GetBytes(parameters); req.ContentLength = byteArray.Length; Stream dataStream = req.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); } HttpWebResponse response = (HttpWebResponse)req.GetResponse();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)