I created a WCF service:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace ISTL
{
public class MatchesListService : IMatchesListService
{
public bool AcceptRequestToChangeMatchTime(int matchId)
{
return MatchesListManager.AcceptRequestToChangeMatchTime(matchId);
}
}
}
That implements this contract:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace ISTL
{
[ServiceContract(Namespace = "ISTL")]
public interface IMatchesListService
{
[OperationContract]
bool AcceptRequestToChangeMatchTime(int matchId);
}
}
And this is in the web.config:
<system.serviceModel>
<services>
<service name="ISTL.MatchesListService">
<endpoint binding="webHttpBinding" contract="ISTL.IMatchesListService"></endpoint>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior>
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
And in the masterPage:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
<Services>
<asp:ServiceReference Path="~/MatchesListService.svc" />
</Services>
</asp:ScriptManager>
I am trying to call my WCF service from my javascript code:
ISTL.IMatchesListService.AcceptRequestToChangeMatchTime(matchId);
But calling the WCF fails. When I debug with FireBug, when I reach the calling line, then the error occurs. matchId is a valid value. FireBug recognizes the ISTL namespace, but regarding IMatchesListService it says its value is 'undefiend'.
Someone know what I'm doing wrong ?
Thanks for helping !