calling web services with javascript
-
I have a question regarding calling web services from client side. You see the company I work for hosts sites in every version of asp - asp.net, and we have to work on a just about all of them. This makes something simple like sending form data to an email address a little bit of a pain. For /Net 2.0 I always use the System.Net.Mail Namespace, for 1.0/1.1 we have some 3rd party dll, and for classic asp we have some dinosaur code that is creating a COM object that seems to break all the time. Now that I have used them all great, but for newer developers here it’s a pain... I won’t lie... It’s a pain for me too. That’s when I thought, hey, why not build a web service and call it with JavaScript, then we could call it from any site with the same script. There is one problem with that though. It seems you have to use an XmlHTTPRequest which will not work cross domain. The thing is, in this case I really don’t care if it’s all, asynchronous and fancy. I just want it to work reliably. Does anyone know a better cross platform solution? Thanks,
-Adam N. Thompson
-
I have a question regarding calling web services from client side. You see the company I work for hosts sites in every version of asp - asp.net, and we have to work on a just about all of them. This makes something simple like sending form data to an email address a little bit of a pain. For /Net 2.0 I always use the System.Net.Mail Namespace, for 1.0/1.1 we have some 3rd party dll, and for classic asp we have some dinosaur code that is creating a COM object that seems to break all the time. Now that I have used them all great, but for newer developers here it’s a pain... I won’t lie... It’s a pain for me too. That’s when I thought, hey, why not build a web service and call it with JavaScript, then we could call it from any site with the same script. There is one problem with that though. It seems you have to use an XmlHTTPRequest which will not work cross domain. The thing is, in this case I really don’t care if it’s all, asynchronous and fancy. I just want it to work reliably. Does anyone know a better cross platform solution? Thanks,
-Adam N. Thompson
AdamNThompson wrote:
Does anyone know a better cross platform solution?
Well, here's what i've done: code up a simple app that'll accept POST requests and do something useful with them. Then POST to it from whatever needs it. And FWIW, even classic ASP can use ServerXMLHTTPRequest to do cross-domain requests server-side.
----
...the wind blows over it and it is gone, and its place remembers it no more...