Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Calling Web Service from ASP.NET AJAX

Reply
Thread Tools

Calling Web Service from ASP.NET AJAX

 
 
NBD
Guest
Posts: n/a
 
      09-27-2007
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


 
Reply With Quote
 
 
 
 
NBD
Guest
Posts: n/a
 
      09-28-2007
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.I nitialize()
at System.Web.Services.Protocols.ServerProtocolFactor y.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

"NBD" wrote:

> 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
>
>

 
Reply With Quote
 
 
 
 
Som Nath Shukla
Guest
Posts: n/a
 
      10-03-2007
first u need u add web referencce to ur web service
then u can access. u r getting error at compile time or runtime

"NBD" wrote:

> 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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'web service call failed: 500' using ajax hovermenu and web service Not Me ASP .Net 1 06-05-2007 03:09 PM
Calling Web Service that calls other Web Service with Windows Authentication manuelserpabrandao@gmail.com ASP .Net Security 1 06-14-2006 08:55 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Calling a Web Service using Axis, from within an Axis Web Service running under Tomcat hocho888 Java 1 04-29-2005 08:26 PM
Calling a web service from a web service JC ASP .Net Web Services 1 08-20-2003 06:51 PM



Advertisments