Page 1 of 1

Accessing experimental features of xLocate server

Posted: Tue Dec 06, 2016 12:53 pm
by kgrudzinski
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.

Re: Accessing experimental features of xLocate server

Posted: Tue Dec 06, 2016 1:13 pm
by matthias
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

Re: Accessing experimental features of xLocate server

Posted: Thu Dec 08, 2016 11:26 am
by kgrudzinski
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:

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); 
			}
		});
		
}
What is the proper way of authenticating my request?

Re: Accessing experimental features of xLocate server

Posted: Thu Dec 08, 2016 4:07 pm
by f.gailfuß
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

Re: Accessing experimental features of xLocate server

Posted: Fri Dec 09, 2016 10:38 am
by kgrudzinski
Everything works now. Thank you for your help.