Java Sample not working

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
egeschwinde
Posts: 1
Joined: Mon Oct 19, 2015 2:35 pm

Java Sample not working

Post by egeschwinde »

Hi,

I'm evaluating the PTV Xserver Internet and I found following Code Sample on this link
http://xserver.ptvgroup.com/dk/cookbook ... d-classes/

I generate with mvn and it generates me a jar file.
The problem what I have is when I try to use the test class the classes
import com.ptvag.jabba.service.baseservices.ArrayOfCallerContextProperty;
import com.ptvag.jabba.service.baseservices.CallerContext;
import com.ptvag.jabba.service.baseservices.CallerContextProperty;
import com.ptvag.xserver.common.ArrayOfPoint;
import com.ptvag.xserver.common.PlainPoint;
import com.ptvag.xserver.common.Point;
import com.ptvag.xserver.xroute.ArrayOfWaypointDesc;
import com.ptvag.xserver.xroute.LinkType;
import com.ptvag.xserver.xroute.ResultListOptions;
import com.ptvag.xserver.xroute.Route;
import com.ptvag.xserver.xroute.WaypointDesc;
import com.ptvag.xserver.xroute.jwsdp.XRouteWS;

Are invalid and missing - from my view it should generate the WSDL with maven or am i missing something here (another Jar maybe) ?

Regards
Ewald Geschwinde
User avatar
Oliver Heilig
Posts: 160
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: Java Sample not working

Post by Oliver Heilig »

Hello Ewald,

we have a more detailed guide for generating java clients from WSDL here:

http://devblog.ptvgroup.com/2013/01/23/ ... -xservers/

It describes the practices with a local xServer, but it should also work with xServer intenet if you replace the url by https://xroute-eu-n-test.cloud.ptvgroup ... Route?WSDL

Unlike C#, generating Java classes from a WSDL is generally a bit cumbersome, so we recommend using the Java client classes that can be downloaded. Se here for a tutorial:

http://xserver.ptvgroup.com/de/cookbook ... lications/

Best regards

Oliver
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Java Sample not working

Post by Bernd Welter »

Not sure whether our samples cover "retrieving the WSDL with authentification"... anyhow: you should be able
  • to download the WSDL file using your token
  • store it locally
  • create the clients on a local basis

Usually the URLs of the services are part of the applications later configuration e.g. because you develop with TEST url and redirect the application for PRODUCTION afterwards.

Best regards Bernd
Post Reply