views:

48

answers:

1

Can I call a SOAP web service from JavaScript? The SOAP web service in question is a member of the Exchange Web Services platform. I have found the Exchange Web Services OSX Widget but that uses Curl to do the actual SOAP call. So I am wondering if there is a limitation in the JavaScript abilities to interface with SOAP using authentication.

A: 

Javascript isn't very good at web services because of the same origin policy which means you're only allowed to request resources from the same domain as the page you call from.

You could work around this by setting up a proxy on your server to hand the request off to elsewhere. The problem with this is you'd have to build the SOAP message yourself as I very much doubt anyone has ever bothered to write a js SOAP library due to the afore mentioned limitations.

Instead, I would pick your favourite server side SOAP library and expose an interface to be called via AJAX.

Ollie Edwards