Note that there are some explanatory texts on larger screens.

plurals
  1. POPOST Method in wcf Rest Service
    text
    copied!<p>i am getting the same error:</p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { BasicHttpBinding binding = new BasicHttpBinding(); binding.ReaderQuotas.MaxStringContentLength = 2000000; binding.MaxBufferSize = 2147483647; binding.MaxReceivedMessageSize = 2147483647; binding.ReaderQuotas.MaxNameTableCharCount = 2147483647; binding.Security.Transport.ClientCredentialTypeHttpClientCredentialType.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); } **web.config** &lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0" /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;webHttpBinding&gt; &lt;binding name="webHttpBinding" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"/&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service name="RestService.RestServiceImpl" behaviorConfiguration="ServiceBehaviour"&gt; &lt;endpoint address ="http://localhost:35798/RestServiceImpl" binding="webHttpBinding" contract="RestService.IRestServiceImpl" behaviorConfiguration="webHttp"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="webHttp"&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt; &lt;dataContractSerializer maxItemsInObjectGraph="6553600"/&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="web"&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true"/&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>What changes should i made in order to make the code working.<br> Error: <code>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.</code> </p> <p>Please help in the indiacted issue.</p>
 

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