943,671 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 30856
  • ASP.NET RSS
Sep 15th, 2008
0

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

Expand Post »
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
Reputation Points: 10
Solved Threads: 3
Light Poster
anish.anick is offline Offline
47 posts
since Jan 2008
Sep 16th, 2008
0

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

Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007
Sep 17th, 2008
0

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

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
Reputation Points: 10
Solved Threads: 3
Light Poster
anish.anick is offline Offline
47 posts
since Jan 2008
Sep 17th, 2008
0

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

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
Reputation Points: 66
Solved Threads: 56
Posting Pro in Training
Fungus1487 is offline Offline
459 posts
since Apr 2007
Sep 25th, 2008
0

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

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..
Reputation Points: 10
Solved Threads: 3
Light Poster
anish.anick is offline Offline
47 posts
since Jan 2008
Sep 27th, 2008
0

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

I have the same problem. Could you please post your sollution using JSON?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
de buurman is offline Offline
2 posts
since Sep 2008
Dec 21st, 2008
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
umerjafer is offline Offline
1 posts
since Dec 2008
Mar 3rd, 2010
0
Re: Call Webservice using javascript (Which works on both IE and Fire fox)
Click to Expand / Collapse  Quote originally posted by umerjafer ...
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.
I hope this helps:

walkthrough for consuming webservices using JQuery

You can also look at the ajax documentation of JQuery itself
Reputation Points: 10
Solved Threads: 0
Newbie Poster
de buurman is offline Offline
2 posts
since Sep 2008
Mar 3rd, 2010
0
Re: Call Webservice using javascript (Which works on both IE and Fire fox)
Hi de buurman.

I appreciate your help. Have you noticed that the current thread is two years old? Please do not resurrect old threads and have a look at forum rules.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in ASP.NET Forum Timeline: Web Services, .net returning multiple related data
Next Thread in ASP.NET Forum Timeline: Viewstate size bytes shows 0 in trace.axd





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC