# Accessing iDigi Web Services from a browser script

**URL:** <https://forums.digi.com/t/accessing-idigi-web-services-from-a-browser-script/3194>\
**Category:** Device Manager\
**Created:** [July 10, 2012, 10:36pm UTC](https://forums.digi.com/t/accessing-idigi-web-services-from-a-browser-script/3194 "2012-07-10T22:36:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![virgil\_disgr4ce](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@virgil\_disgr4ce](https://forums.digi.com/u/virgil_disgr4ce)\
**Post date:** [July 10, 2012, 10:36pm UTC](https://forums.digi.com/t/accessing-idigi-web-services-from-a-browser-script/3194/1 "2012-07-10T22:36:32Z")

</div>

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: [http://www.digi.com/wiki/developer/index.php/Basic\_Web\_Services\_Example\_using\_iDigi\_Dia](http://www.digi.com/wiki/developer/index.php/Basic_Web_Services_Example_using_iDigi_Dia)

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

```auto
XMLHttpRequest cannot load http://developer.idigi.com/ws/sci. 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:

```auto
$.ajax({
    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.

---

<div class="post-metadata">

**Author:** ![virgil\_disgr4ce](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@virgil\_disgr4ce](https://forums.digi.com/u/virgil_disgr4ce)\
**Post date:** [July 10, 2012, 11:12pm UTC](https://forums.digi.com/t/accessing-idigi-web-services-from-a-browser-script/3194/2 "2012-07-10T23:12:34Z")

</div>

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. ☹

---

<div class="post-metadata">

**Author:** ![faludi](https://avatars.discourse-cdn.com/v4/letter/f/f14d63/32.png) [@faludi](https://forums.digi.com/u/faludi)\
**Post date:** [July 11, 2012, 10:58pm UTC](https://forums.digi.com/t/accessing-idigi-web-services-from-a-browser-script/3194/3 "2012-07-11T22:58:25Z")

</div>

Based on your feedback, the Basic Web Services Example has just been updated and should now provide clearer information: [http://www.digi.com/wiki/developer/index.php/Basic\_Web\_Services\_Example\_using\_iDigi\_Dia](http://www.digi.com/wiki/developer/index.php/Basic_Web_Services_Example_using_iDigi_Dia)
