Work Client Example
Import of Interfaces
wsimport -d bin -s src http://demo.omnicomm.ru/AnalyticalServer/ws?wsdl
Java code:
It is necessary to change strings “user” and “pass” by real values.
package ru.omnicomm.test.client; import ru.omnicomm.analyticalserver.*; import java.net.MalformedURLException; import java.net.URL; import java.util.List; public class ExampleClient { public static void main(String[] args) throws MalformedURLException { AnalyticalServer = new AnalyticalServer(new URL("http://demo.omnicomm.ru:8000/AnalyticalServer/ws?wsdl")); AnalyticalServerWS port = AnalyticalServer.getAnalyticalServerPort(); AuthResponseEntry auth = port.signIn("user", "pass"); String sessionId = auth.getsessionId (); System.out.println("auth sessionId: " + sessionId); ObjectSetResponseEntry objects = port.getObjectSet(sessionId); List<Vehicle> vehicles = objects.getVehicleList(); for (Vehicle vehicle : vehicles) { System.out.printf("vehicle: %d / %s\n", vehicle.getVehicleID(), vehicle.getRegNmb()); } } }