Developer's Guide > Programming Environment > Generating Clients

Generating Clients

To develop an application or batch processing program, you need client code that deals with the serialisation of your request objects, communication with the PTV xServer, and deserialisation of the response objects. You can use the client classes provided with PTV xServer for your convenience. Should you use other programming languages, or cannot use these client classes, or do not want to use these classes, you can generate your own classes as well.

Java Clients

For Java developers seeking a good starting point for SOAP client generation we recommend soapUI, a free and open source cross-platform functional testing solution released by SMARTBEAR. This tool integrates a variety of Java SOAP frameworks and enables fast generation of code from WSDLs.

C# Clients

C# developers should not need any external tools: Visual Studio already includes tools for generating clients from a WSDL. It is important to generate asynchronous operations when generating a service reference. Inside the "add Service Reference" advanced options can be configured. Here, please enable the generation of asynchronous operations.

For JSON serialisation and deserialisation, there are frameworks and libraries available for most programming languages. You can find an extensive list of parsers and serialisers at JSON.org.

JavaScript

JavaScript developers do not need specific client classes to encapsulate object types: there simply are no strict object types. The communication is made simple and convenient by several alternative mature Ajax frameworks. Any of these will do. Below is an example using JQuery:

var request = {
  "waypoints": [
    {
       "coords": [ { "point": { "x": 685903,"y": 6372958 }} ],
       "linkType": "NEXT_SEGMENT"
    },
    {
       "coords": [ { "point": { "x": 681013,"y": 6371680 }} ],
       "linkType": "NEXT_SEGMENT"
       "options": [],
       "exceptionPaths": [],
       "callerContext": { "properties": [] }
};

$.ajax({
  type: 'POST',
  url: "http://localhost:50030/xroute/rs/XRoute/calculateRouteInfo",
  contentType:"application/json; charset=utf-8",
  data: JSON.stringify(request),
  success: function(data) { alert(data.distance); }
});