Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2009, 02:36 PM
Authorized User
 
Join Date: May 2006
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to pratik28
Default problem while calling webservice method in java script in firefox

I have copied down code behind for webservice and javascript serially .They are as follows:

Here is the code snippet for web service:
public class WebService1 : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{

return "Hello this is pratik";
}

}

And here goes the code snippnet for the .js file:

function CallWebService()
{
WebService1.HelloWorld(SucceededCallback);
}

// This is the callback function that
// processes the Web Service return value.
function SucceededCallback(result)
{
alert(result);
}


In IE there is no problem in getting the result .But in firefox i get the error :
"the server method "helloworld" failed with the following error" , but no error is specified in the error window.

For the info,i am using firefox version "3.0.7"

it would be great of you guys out there if you can help me out.Thanks in advance
__________________
imspratik
 
Old March 30th, 2009, 04:09 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It is not immediately apparent what is wrong. I would probably do 2 things: add a break point to your JavaScript method and add a breakpoint in your CS file and step through everything.

javascript Code:
function CallWebService()
{
 debugger
 WebService1.HelloWorld(SucceededCallback);
}
// This is the callback function that
// processes the Web Service return value.
function SucceededCallback(result)
{
 alert(result);
}

Make sure you enable script debugging in Firefox so that the breakpoint will be hit in your JavaScript.

hth
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
pratik28 (April 1st, 2009)
 
Old April 1st, 2009, 04:01 AM
Authorized User
 
Join Date: May 2006
Posts: 23
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to pratik28
Default

Thanks for the suggestion,

your way of debugging with firebug can find out the problem.
Mean while i also suspect with the configuration and settings in my firefox browser.
I will get to you definitly if problem still persists.
__________________
imspratik





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Java Method via javascript basildudin J2EE 5 October 16th, 2008 12:00 AM
Error calling a method in the webservice madhusrp .NET Web Services 1 April 12th, 2007 08:54 AM
CALLING A TEMPLATE WITHIN JAVA SCRIPT SOMANATHAN10 XSLT 6 February 14th, 2007 02:10 AM
Java script function is not calling in Mozilla mouli_sam ASP.NET 1.0 and 1.1 Professional 0 May 9th, 2006 01:44 AM
Problem calling a script from IE kwilliams General .NET 1 February 1st, 2006 04:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.