Samples and Clients for xServer2 (Java)

Proper forum for all questions related to xServer INTERNET = the Azure based cloud solution. This forum deals with the architecture topics such as load balancing, available profiles and standard server settings.
Please be aware that questions about core functionality such as routing, mapping, geocoding in general should be placed in the xServers dedicated forum ;-)
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Samples and Clients for xServer2 (Java)

Post by Bernd Welter »

Hello there,

a customer of mine wants to connect to xServer INTERNET via Java. Two simple questions:
  • Where do we provide the Java client classes on our website? In other words: where are integrators without an on premise version supposed to find client classes? I found this ressource but that's really tricky to spot.
    Screenshot taken from <br />https://xserver2-europe-eu-test.cloud.ptvgroup.com/dashboard/Default.htm#DevelopersGuide/DSC_UsingWithJava.htm%3FTocPath%3DDeveloper's%2520Guide%7C_____4
    Screenshot taken from
    https://xserver2-europe-eu-test.cloud.ptvgroup.com/dashboard/Default.htm#DevelopersGuide/DSC_UsingWithJava.htm%3FTocPath%3DDeveloper's%2520Guide%7C_____4
  • Do we provide some sample code including the authentification part (remote URL , network credentials) in Java?
Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Samples and Clients for xServer2 (Java)

Post by Bernd Welter »

Hi there,

I assume this is the missing link:
Screenshot from the upcoming documentation (thank you, Marco)
Screenshot from the upcoming documentation (thank you, Marco)
It shows how to set username and token via our JAVA clients.

Code: Select all

String host = "https://xserver2-europe-eu-test.cloud.ptvgroup.com/services/ws/XRoute";
	XRoute client = (XRoute) new XRoute_Service(new URL(host)).getXroute();
      
	// Set the token via basic authentication      
	BindingProvider prov = (BindingProvider)client;
	prov.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "xtok");
	prov.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "<your xServer-internet token>");
        
	client.calculateRoute(
	...
Best regards,
Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply