Accessing iDigi Web Services from a browser script

Hi all,

I’m trying to build a custom web client for iDigi on my own server and having trouble getting it to work.

First I tried the Basic Web Services Example here:

But have never been able to get it to work on any browser, because the request always gives this error:

XMLHttpRequest cannot load Origin http://(mydomain) is not allowed by Access-Control-Allow-Origin.

As far as I can tell, iDigi is not serving the Access-Control-Allow-Origin header at all, implying that no one would be allowed to access iDigi web services from a browser at all. That would really be disappointing, wouldn’t it?

However, I found one situation in which I can make it work, on Safari OSX, but only when read as a local file (file:// scheme instead of http://)! Bizarre???

The jQuery ajax request I’m using looks like:

    url: idigiURL+"/ws/sci",
    data: whichXML,
    type: 'GET',
    dataType: "text/xml",
    success: gotResponse,

This is the barest form that works as a local file in Safari.

So clearly it is possible, but there’s got to be some other information necessary for getting it to work on any browser from any origin domain.

Has anyone else gotten any of this to work? I’m frustrated that it’s been so difficult to get this going.

Well, I just talked to someone at Digi and they confirmed that web services are not intended to be accessed by a browser script, only a server-side call. So there goes that. :frowning:

Based on your feedback, the Basic Web Services Example has just been updated and should now provide clearer information: