I think I got the web.config right but I'd want to know how to add the service reference or the web service itself on the aspx page so my script could access it.
here's what I did but it doesn't work:
<%@ ServiceHost Language=C# Service="WebService" CodeBehind="http://urlToMyService.svc"%>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference
Path="http://urlToMyService.svc"/>
</Services>
</asp:ScriptManager>
I think I need to add the <%@ ServiceHost %> and <asp:ScriptManager> but I'd like a clearer example on every parameters I need to include.
You can add only references to local services (i.e. services that exist in your ASP.NET web application). So typical service reference goes like
on aspx page (or master page or user control). You don't need
<%@ ServiceHost %>etc - that will appear insvcfile.Note that adding service reference to
ScriptManagergenerates a java script service proxy that will simplify calling your web service from java-script. This is not useful for calling the service from code (on server side). See this tutorial to get started on invoking services from java-script: http://www.codeproject.com/KB/aspnet/wcfinjavascript.aspxFor calling services from server side code, you have to add service reference from Visual Studio (right-click on your project and choose Add Service Reference context menu) - in such case, VS generates the proxy code to make call to the service.