Call Webservice using javascript (Which works on both IE and Fire fox)

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 35
Reputation: anish.anick is an unknown quantity at this point 
Solved Threads: 3
anish.anick anish.anick is offline Offline
Light Poster

Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #1
Sep 15th, 2008
Hi All,
Please tell me how i can call a web service from an HTML page using javascript which works fine on both IE and fire fox.I was successful in calling a ASP.NET web service using javascript in Internet Explorer (using service.useService method).Unfortunately the service.useService method is not working in fire fox. Please guid me to fix this.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #2
Sep 16th, 2008
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 35
Reputation: anish.anick is an unknown quantity at this point 
Solved Threads: 3
anish.anick anish.anick is offline Offline
Light Poster

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #3
Sep 17th, 2008
Hi
Thanks for the reply. But i want some thing different. I will explain the scenario correctly.
I have an Asp.Net webservice in our domain "xyz", and the webservice can be accessed through http://www.xyz.com/Servecies/MyService.asmx. I want to call this webservice from a pure HTML page using javascript. This HTML page resides in another domain where we doesn't have any access to that HTML page. We have the right to provide only the Javascript functions or javascript files to call this web service. I got a cross domain issue while doing a test application. How can i fix this cross domain web service issue in both IE and Fire fox .. Please help me.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 437
Reputation: Fungus1487 is on a distinguished road 
Solved Threads: 50
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Pro in Training

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #4
Sep 17th, 2008
You cant.

Not just using javascript.

With IE you can get your user to set there browser settings to low and it will let them do this but firefox or any other browser will not allow it as its a major security leak.

The best ways i have seen/and done this are the following 2 methods.

1) Create a web service page to give to your client/supplier which calls the webservice on a seperate domain. Then call the "same domain" web service in your javascript. The server side code wont have any restrictions on cross domain interaction.

2) Create a flash object which initialises XMLHTTP as flash doesnt have any objections to retrieving data across domains. Then when you have read all your info into your flash movie pass the data to your javascript in the same page.


Option 1 Seems to be a more elegant solution but if your page is flash heavy then maybe there is a possibility you could use this technique. There seems to be some movement towards creating a standard to allow cross domain interaction but i cant see it coming to light for javascript for a very long time if ever.

Hope this helps
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 35
Reputation: anish.anick is an unknown quantity at this point 
Solved Threads: 3
anish.anick anish.anick is offline Offline
Light Poster

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #5
Sep 25th, 2008
Hi
Unfortunately we cant use these two suggestion since our requirement does not allow to do so. I was able to solve this issue using JSON. Thanks for the information..
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1
Reputation: de buurman is an unknown quantity at this point 
Solved Threads: 0
de buurman de buurman is offline Offline
Newbie Poster

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #6
Sep 27th, 2008
I have the same problem. Could you please post your sollution using JSON?
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1
Reputation: umerjafer is an unknown quantity at this point 
Solved Threads: 0
umerjafer umerjafer is offline Offline
Newbie Poster

Re: Call Webservice using javascript (Which works on both IE and Fire fox)

 
0
  #7
Dec 21st, 2008
Originally Posted by anish.anick View Post
Hi
Unfortunately we cant use these two suggestion since our requirement does not allow to do so. I was able to solve this issue using JSON. Thanks for the information..
Hi, I also have exactly the same requirements and I am also unable to call web service on Fire Fox. I have tried different methods but none have been successful. I would like to get some tips related to the solution which you have provided using JSON.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC