Here is my problem: I have a web service method which returns simple string:
namespace webStockService
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script,
// using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class StockService : System.Web.Services.WebService
{
[WebMethod]
public string getChallenge()
{
//some codes
return string;
}
}
I want to call this service in javascript:
try
{
var challenge = webStockService.StockService.getChallenge();
}
catch(e)
{
alert(e.messsage);
}
I have not got any error message in my call, but when I debug my script the challenge is undefined
!!!
I have tested my web service method in asmx fashion and it invokes properly and returns string.
I also have inserted scriptManager tag in my html:
<asp:ScriptManager ID="webStockService" runat="server">
<Services>
<asp:ServiceReference Path="StockService.asmx" />
</Services>
</asp:ScriptManager>
any help would be appreciated.