Hello,
Is there a way to access experimental features of xLocate server by means of XLocateClient? I could not find in documentation how to include xlocate-client.js.
Accessing experimental features of xLocate server
-
- Posts: 12
- Joined: Fri Feb 19, 2016 10:56 am
Re: Accessing experimental features of xLocate server
With the 2.0 Release of xServer it is unfortunatly not possible to access the experimental features using the deployed client. You will have to access it yourself using tools like jquery. See the documentation in section Developers Guide -> Using xserver with Javascript -> Generating clients. Make sure you use the experimental URL like http://your_server_ip:port/services/rs/XLocate/experimental.
The good news is that starting with the 2.1 release it will be possible to use the deployed client with experimental APIs! Then you can simply create the client like this:
var xlocate = new XLocateClient("experimental");
Best regards,
Matthias
The good news is that starting with the 2.1 release it will be possible to use the deployed client with experimental APIs! Then you can simply create the client like this:
var xlocate = new XLocateClient("experimental");
Best regards,
Matthias
-
- Posts: 12
- Joined: Fri Feb 19, 2016 10:56 am
Re: Accessing experimental features of xLocate server
I have a follow up question. I am using PTV xServer INTERNET so I replaced http://your_server_ip:port/ from Your answer with https://xserver2-europe-test.cloud.ptvgroup.com/ and I am getting 403 forbidden error. I suspect it is caused by bad authentication. I followed this example but it does not seem to work.
My code looks like this:
What is the proper way of authenticating my request?
My code looks like this:
Code: Select all
var newSearch = function(locateUrl, text, token) {
var url = locateUrl+'locations/'+text;
$.ajax({
url: url,
type: "GET",
headers: {
"Authorization": "Basic " + btoa("xtok:" + token)
},
success: function(data, status, xhr) {
console.log(data);
},
error: function(xhr, status, error) {
console.log(error);
}
});
}
Re: Accessing experimental features of xLocate server
Basic authentication is used for POST requests; For GET requests, the token is simply provided through the request parameter "xtok" like this:
https://xserver2-europe-test.cloud.ptvg ... our-token>
Best regards,
Frank
https://xserver2-europe-test.cloud.ptvg ... our-token>
Best regards,
Frank
Frank Gailfuß
PTV GROUP Germany
PTV GROUP Germany
-
- Posts: 12
- Joined: Fri Feb 19, 2016 10:56 am
Re: Accessing experimental features of xLocate server
Everything works now. Thank you for your help.