all groups > asp.net webservices > september 2007 >
You're in the

asp.net webservices

group:

Calling Web Service from ASP.NET AJAX



Calling Web Service from ASP.NET AJAX NBD
9/27/2007 3:57:03 PM
asp.net webservices: Hi,

I am getting a 'web service undefined' error when calling a web service from
Javascript which I've defined inside the ScriptManager tag like so:

<asj:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asj:ServiceReference Path="~/Services/MyWS.asmx" InlineScript
="True" />
</Services>
</asj:ScriptManager>

I'm calling the service from Javascript function like so:

function CallWS()
{
Namespace.MyWS.MyMethod(var);
}

The error message says that the class is 'undefined'. I've tried different
variations of namespaces and class names but no dice..

Any help is appreciated.

Thanks,

NBD

RE: Calling Web Service from ASP.NET AJAX NBD
9/28/2007 11:40:00 AM
I used Fiddler to catch the network messages and I got this:


System.InvalidOperationException: jsdebug Web Service method name is not
valid.
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)

The method is pretty straigthforward - three ByVal input params (all string
type). I have also set the attribute of the class to <ScriptService()> _

Would anyone know why the method name is not valid?

NBD

[quoted text, click to view]
RE: Calling Web Service from ASP.NET AJAX Som Nath Shukla
10/3/2007 3:23:03 AM
first u need u add web referencce to ur web service
then u can access. u r getting error at compile time or runtime

[quoted text, click to view]
AddThis Social Bookmark Button