Calling Web Service from ASP.NET AJAX

N

NBD

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
 
N

NBD

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
 
S

Som Nath Shukla

first u need u add web referencce to ur web service
then u can access. u r getting error at compile time or runtime
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,191
Latest member
BuyKetoBeez

Latest Threads

Top