How to use Enyo 2.0 WebService object

I am building a Campfire client that will run in WebOS and as a Chrome desktop web app. I have the following code:

logIn: function(){
    this.apiToken = this.$.loginScreen.$.apiToken.getValue();
    this.subdomain = this.$.loginScreen.$.subdomain.getValue();
    this.fullURL = 'https://' + this.subdomain + '';
    this.$.roomService.url = this.fullURL + 'rooms.json';
    var response = this.$.roomService.send({'Authorization': "Bearer " + this.apiToken, 'Access-Control-Allow-Origin': this.subdomain + ''});

The 'roomService' is like this:

{name: "roomService", kind: "enyo.WebService", url: null, onResponse: "successfulAlert", onError: "someFailure"}

And in Chromium I keep getting the following XMLHttpRequest error:

Origin null is not allowed by Access-Control-Allow-Origin.

Any ideas?


You might want to take a look at this StackOverflow question:

XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin

You're being blocked by trying to run this from a file:// URL.

Need Your Help

Enable remote blog publishing for custom blog engine

c# blogs

I'm writing a very simple lightweight blog engine with ASP.NET MVC 4. One thing I'd like to allow is remote publishing. That way I can use something like Windows Live Writer to publish blog posts...

Cloud computing - Azure

.net cloud

We are looking for information on migrating existing Asp.Net 2.0 web application to cloud(Azure).