Note that there are some explanatory texts on larger screens.

plurals
  1. POPOST Method in wcf Rest Service
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/7146519/post-method-in-wcf-rest-service">POST Method in wcf Rest Service</a> </p> </blockquote> <p>I am not able to use POST Method in wcf Rest service.Please help to the following code</p> <p>Interface Implementation</p> <pre><code>[OperationContract] [WebInvoke( UriTemplate = "/SendMail",Method ="POST", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)] EmailDetails SendMail(EmailDetails rData); protected void Button1_Click(object sender, EventArgs e) { BasicHttpBinding binding = new BasicHttpBinding(); binding.ReaderQuotas.MaxStringContentLength = 2000000; binding.ReaderQuotas.MaxNameTableCharCount = 2147483647; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly; binding.CloseTimeout = new TimeSpan(4, 0, 0); binding.OpenTimeout=new TimeSpan(4, 0, 0); binding.ReceiveTimeout=new TimeSpan(2, 0, 0); binding.SendTimeout = new TimeSpan(5, 0, 0); EndpointAddress endpoint = new EndpointAddress(new Uri("http://localhost:35798/RestServiceImpl.svc")); RestPostService.RestServiceImplClient obj = new RestPostService.RestServiceImplClient(binding, endpoint); RestPostService.EmailDetails obj1 = new RestPostService.EmailDetails(); obj.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials; RestPostService.EmailDetails obj2=obj.SendMail(obj1); } </code></pre> <p>It is returning a error:remote server not found and sometimes The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload