[thelist] send xml request to webservice via JS

Matt Warden mwarden at gmail.com
Fri Oct 28 10:12:05 CDT 2005


On 10/28/05, Christian Giordano <ml at nuthinking.com> wrote:
> > Are you sure it can't be a permission issue? Everytime I try on my
> > apache with IE to use the webservice I get an Alert saying "This page is
> > accessing information that is not under its control...", on mozilla
> > nothing. But if I put the page in an hostingm, in IE I get a permission
> > denied JS error.
>
> Yes, watching JavaScprit console it was a permission issue :(
> Does anyone know how could I do to make tests calling webservices in
> other servers?

You must proxy it via your server.

So:

1. JavaScript calls PHP file on your server
2. PHP forwards request to web service
3. PHP receives response from web service
4. PHP writes response to JavaScript

(obviously doesn't have to be PHP; just some server-side scripting language)

see: http://php.net/file_get_contents

--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list