Hi , Before in .net 2005 ,I use to consume the web service from client side via Ajax and java script. that's just adding web service inside the script manger services.
But it was not possible with .net 2008 version WEB APPLICATION , Even it works well with .net 2008 web sites.
Please help me to solve the issue.
I have no idea what you mean. Please post the code that "does not work".
I have the same problem. I have a .NET 3.5 Web Application not Web Site. I fully qualify the web service with the namespace i,e,
ClientServices.ControlServer.HelloWorld(controlName, SucceededCallbackWithContext, FailedCallback, HTMLtarget);
The webservice it self is decorated with the ScriptService and the WebMethod is decorated with the WebMethod and the ScriptMethod attributes:
public string HelloWorld(string message)
p.s. not sure if this is an IE8.0 bug with the asp.net forum but if you scroll while making a quick reply so it is out of view you lose everything you have just written
Blog : andrewrea.co.uk
Here the error was,
To use the web service in java script i use the below code,
<asp:ScriptManager ID="ScriptManager1" runat="server">
<asp:ServiceReference Path="MySampleService.asmx" />
Which called by using the statement MySampleService.Helloworld() in java script, Which works good in 2008 web sites but not in 2008 web applications the script error says "MySampleService was not defined"
Hi,I have similar problem and I solved this issue .......
Just simply change the nameSpace
[WebService(Namespace = "http://localhost:49232/Khalid99h/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
//rest of your code..........
Now you can access this web service like this:
//Java script OR Code behind file
Khalid99h.Service.HelloWorld( ); //assume there is a function in web service Helloworld()
Hafiz khalid nawaz
eSoul consultancy pvt ltd
Hello Thank you very much i will try andlet you know