Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a rest service which contains two methods one method to get the records from data base using Get verb.I'm successful in getting that.But while another method is post which is used to insert a record in to the table. But it is giving error response text as:

Here is the response given to my html file:

HTML
  <body>

    <div id="content">

      <p class="heading1">Request Error</p>

      <p>The server encountered an error processing the request. The exception message is 'An error occurred while updating the entries. See the inner exception for details.'. See server logs for more details. The exception stack trace is: </p>

      <p>   at System.Data.Entity.Internal.InternalContext.SaveChanges()

   at EmployeeService.EmployeeInfoService.InsertEmployee()

   at SyncInvokeInsertEmployee(Object , Object[] , Object[] )

   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)

   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)

   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)

   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>

    </div>

  </body>

</html>



But I'm able to insert the record by not hosting in IIS.
Before i was unable to get the records also.I that time i searched the internet.They said you should add network service login to sql server and add suitable priveleges to the data base. After that i'm able to get the records and display in browser.But the insertion is not happening.Please suggest me the solution?
Posted
Comments
ZurdoDev 5-Apr-13 8:09am    
You need to get the inner exception details.
[no name] 5-Apr-13 8:11am    
How to get the inner exception in wcf service.
ZurdoDev 5-Apr-13 8:13am    
Who's service is it? If it is not your service how can we tell you why it is not working? Contact whoever created the service and let them help you.
[no name] 5-Apr-13 8:16am    
Its my service only.I'm able to insert same without hosting in iis.But while hosting in iis it is giving the following response text.
ZurdoDev 5-Apr-13 8:17am    
Yes, put logging on.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900