WCF service - HTTP500
- by ilkin
Hi guys,
I need help with wcf service. i have a ajax-enabled wcf service:
public class AddFavorites : Page
{
// Add [WebGet] attribute to use HTTP GET
[WebGet(RequestFormat = WebMessageFormat.Json)]
[OperationContract]
public void AddFavorite()
{
this.AddMyFavorite(10, "sometext", "sometext");
}
}
And clientside looks like this:
function AddFavorite() {
$.ajax({
type: "GET",
url: "/WebServices/AddFavorites.svc/AddFavorite",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false
});
};
Im using fiddler to trace the application and i always get HTTP500. The class is inherited from Page class and uses the AddMyFavorite method that takes care of database. Website is hosted on iis7