lnetanel
lnetanel

Reputation: 1118

Calling a WebService from javascript

I'm developing a Firefox addon that needs to interact with an external WebService
The WebSerivce is build using ASP.NET (.asmx page)

I cannot use ajax because it's an addon and not a web site.
Does anyone knows how to do it?

Upvotes: 1

Views: 1120

Answers (4)

Dave Anderson
Dave Anderson

Reputation: 12294

You will need to consider the cross domain issues initiating a call from your Add-On to the service.

The XMLHttpRequest object is one of the fundamental building blocks of AJAX. I'm unsure about the isolation of your Add-On but it seems strange that you would be unable to use it.

The language the web service is created with is unimportant you just need to know which web service protocol it requries. Just as when you visit a website you are able to be agnostic to whether it is php, asp or jsp producing the HTML you just need to know how to handle the HTML.

Upvotes: 1

jrharshath
jrharshath

Reputation: 26583

Check out this link: It clearly mentions that XMLHttpRequest can be used from Mozilla extensions. https://developer.mozilla.org/En/Using_XMLHttpRequest#Downloading_JSON.c2.a0and_JavaScript_from_extensions

Upvotes: 1

Sourabh
Sourabh

Reputation: 1615

Check Out Call an ASP.NET web service from JavaScript

Upvotes: 0

Rihan Meij
Rihan Meij

Reputation: 1759

If you would like to do it all manually you need to use the XMLHttp Object. This however can become quite painfull, and that is the reason why there is a lot of Javascript libaries, to make the task of getting and sending data less painful.

Upvotes: 2

Related Questions