Developer's Guide > Programming Guidelines

Programming Guidelines

Introduction

The programming guidelines may help you to develop your own application quite quickly. In order to avoid critical programming failures PTV recommends to read these instructions carefully.

Caution: The following programming guidelines are important and obligatory for developers who want to use PTV xServer internet as a cloud service hosted in Windows Azure™ for your own web solutions.

General Programming Guidelines

PTV provides client classes for C# and Java. PTV recommends to use a powerful programming environment such as Visual Studio or Eclipse. Detailed information how to connect to PTV xServer to develop web services are explained in the following pages:


The WSDL of the PTV xServer supports SOAP version 1.2 to its full extent. Logically, the client generator of your programming tools must be in a current state to create correct client classes (using abstract classes, enumerations, inherited objects, etc.)


In order to get familiar with the PTV xServer, please use the information as follows:

  1. Use PTV's API for development purposes. All parameters, values, keys, methods and more are described in detail to fulfill your requirements according to the programming guidelines.
  2. Use the tutorials of PTV's code samples which are part of PTV Cookbook. Download the entire code sources.
  3. How to use JavaScript for your own web applications run PTV's Code Sample Browser as a specific tutorial.
  4. Use the specific "utils" package for java applications. Hereby, a set of convenience classes are provided concerning PTV xServer functionalities. Especially the instantiation of PTV xServer clients are simplified as following example illustrates:
final String XMAP_WS_URL = "http://localhost:50010/xmap/ws/XMap";

// Without use of package utils: instantiate the class "ClientFactory""
XMapRemoteInterface xmapClient = (XMapRemoteInterface) ClientFactory.
createClient(XMapRemoteInterface.class, RemoteType.DOCSTYLE_CXF, "", "", XMAP_WS_URL);

// Importing the package utils 
XMapRemoteInterface xmapClient = XMapUtils.makeClient(XMAP_WS_URL);
  1. Add PTV's exception handling for each method. Following code snippet shall exemplarily illustrate the use of try/catch-commands:
Map map = client.renderMap(mapSection, mapParams, imageInfo, null, includeImageInResponse);
    ...
} catch (SystemException se) {
    System.err.println("Network or URL problem: " + se);
	...
} catch (XMapException xme) {
	System.err.println("Problem rendering map");
	...
} catch (XServiceException xse) {
	System.err.println("Technical problem on server");
	...
}

Specific Programming Guidelines PTV xServer on Premise

Some more important notes concerning installation, configuration and administration.

Specific Programming Guidelines PTV xServer internet

The Developer Guide is an online tutorial to discover the benefits of the hosted services and getting a successful start-up.