Calling Webservice throught Javascript
-
Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??
-
Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??
I am assuming this code uses AJAX to make the call. I would import the web service using the usual mechanisms so that you end up with a helper class in your project and you just call that.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I am assuming this code uses AJAX to make the call. I would import the web service using the usual mechanisms so that you end up with a helper class in your project and you just call that.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi...thanks for replying.... i have written "ScriptManagerMain.Services[0].Path = autoFillService.Url;" in the Page_load event. where autoFillService is the object of my webservice....but it couldnt help me out..when i debug it.....i am getting the correct path into the path....can u help me ? thanks, deep.
-
Hi...thanks for replying.... i have written "ScriptManagerMain.Services[0].Path = autoFillService.Url;" in the Page_load event. where autoFillService is the object of my webservice....but it couldnt help me out..when i debug it.....i am getting the correct path into the path....can u help me ? thanks, deep.
To be honest, I answered b/c the question was unanswered, I've not looked at this code. It doesn't use AJAX to make a web service call from code behind ? If it does, I am still all for adding a proper web reference and just calling it, then it's just plain AJAX.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
To be honest, I answered b/c the question was unanswered, I've not looked at this code. It doesn't use AJAX to make a web service call from code behind ? If it does, I am still all for adding a proper web reference and just calling it, then it's just plain AJAX.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Hi...please go through this URL and read my question...u will understand wat i am asking http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[ href="http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx" target="_blank" title="New Window">^]....i hope u can suggest something.... Thanks, deep.
-
Hi, I need to call a webservice through javascript, i am using scripmanager(http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx[^]....it was succesfful when i use webservice in my project..now i need to use a webservice which is running from another machine....i tried to give path to the serviceReference trough code...the path is something like this(http://165.8.15.10/myServices/WebServiceone.asmx), but couldnt solve it...Javascript throws error that "WebServiceone" is undefined.....i have googled and found that we can use .HTC and solve it..is there any other way? or..can anyone help me to solve this??
Check this link http://www.webtips.co.in/javascript/javascript-client-code-to-call-webservice.aspx[^]
Regards, Webtips - Web Development tips