Start a new topic

Webservice

Webservice


Hi all,

Me and my college are using wikitude to make an application. We wanted to obtain data from a webservice to use in our project ( with native data screen )

We uploaded our own json data to our website ( http://www.smartbustracking.be/json/ ) and we followed the steps on the wikitude website (http://www.wikitude.com/developer/documentation/ios) but we didn't managed to make it work. The radar is shown but no POI data is on the screen. 

We are building the application with Xamarin, but we are new to this.

Can anybody help us with this problem ? 

Hi,

Since the request to your server is done using JavaScript, you need to ensure you set the right headers in your server to allow Cross-Domain Scripting.

When you check the developer console in your browser when you request your URL through AJAX (*not* the browser address bar) for example in Chrome, you will see the following error:

"XMLHttpRequest cannot load http://www.smartbustracking.be/json/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access."

There are several posts already on our Forum dealing with this issue, and how to fix it. An example is this post:

https://support.wikitude.com/support/search/topics?term=Access-Control-Allow-Origin

but when you search on "Access control" in our forum, you will find lots os similar articles.

Best,

Martin

Thank you for the quick response.

We added an .htaccess file with this : 

Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"


We now see, when we run the application that it loads ( in our case ) 5 pois but it's not displayed on the screen.
 

Do you have any idea what's the problem ? 

Thanks again

Hi,

I don't see issues with this configuration. I suggest you do some debugging to see whether the JavaScript is executed correctly, and if the objects are generated successfully. I urge you to use the ADE for these debugging-steps.

Best,

Martin
Login or Signup to post a comment