gillsboy123
asked on
IIS 7 configuring .asmx WEB SERVICE TO WORK
I have just had to reinstall the lot basically. My current project uses webservice, .asmx to make ajax calls to server to return data and respond without page refresh.
IIS has been enabled a new. I cannot get my .js method to successfully call server side web service method. I just get an error stating that service is undefined.
Here is my code, from what i gather it is correct and is something I need to do to enable IIS once again to correctly allow .asmx web services to work, any ideas?
Here is page reference:
<body>
<form runat="server">
<ajaxToolkit:ToolkitScript Manager ID="ScriptManager1" EnablePageMethods="true" runat="server">
<Scripts>
<asp:ScriptReference Path="ServiceClientScript. js" />
</Scripts>
<Services>
<asp:ServiceReference Path="Service.asmx" />
</Services>
</ajaxToolkit:ToolkitScrip tManager>
<div class="page">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
</form>
</body>
Here is .asmx
<%@ WebService Language="C#" CodeBehind="~/App_Code/Ser vice.cs" Class="Tester.Call.Service " %>
Here is .cs web service method:
namespace Tester.Call
{
/// <summary>
/// Summary description for Service
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform sTo = WsiProfiles.BasicProfile1_ 1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Service s.ScriptSe rvice]
public class Service : System.Web.Services.WebSer vice
{
[WebMethod]
public string HelloWorld()
{
int one = 1 + 2;
return "Hello World";
}
}
}
here is calling .js funtion:
function ClickMe() {
Tester.Call.SpriteProficie ntServices .HelloWorl d();
}
I would be grateful for any guidance, I am using Vista home premium with IIS 7 and .NET 2010. It all worked fine befor re-install of OS.
IIS has been enabled a new. I cannot get my .js method to successfully call server side web service method. I just get an error stating that service is undefined.
Here is my code, from what i gather it is correct and is something I need to do to enable IIS once again to correctly allow .asmx web services to work, any ideas?
Here is page reference:
<body>
<form runat="server">
<ajaxToolkit:ToolkitScript
<Scripts>
<asp:ScriptReference Path="ServiceClientScript.
</Scripts>
<Services>
<asp:ServiceReference Path="Service.asmx" />
</Services>
</ajaxToolkit:ToolkitScrip
<div class="page">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
</form>
</body>
Here is .asmx
<%@ WebService Language="C#" CodeBehind="~/App_Code/Ser
Here is .cs web service method:
namespace Tester.Call
{
/// <summary>
/// Summary description for Service
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Service
public class Service : System.Web.Services.WebSer
{
[WebMethod]
public string HelloWorld()
{
int one = 1 + 2;
return "Hello World";
}
}
}
here is calling .js funtion:
function ClickMe() {
Tester.Call.SpriteProficie
}
I would be grateful for any guidance, I am using Vista home premium with IIS 7 and .NET 2010. It all worked fine befor re-install of OS.
ASKER
Thats of no use for me. As far as I am aware WCF is not what I am doing. Also I am not running a Windows Service. Iam just trying to get my .asmx files and server Side Web Service.cs file to work in IIS 7.
It works fine in webdev, but naturally I need it in IIS.
It works fine in webdev, but naturally I need it in IIS.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hope it helps