Пример рабочего клиента
Импорт интерфейсов
wsimport -d bin -s src http://demo.omnicomm.ru:8000/AnalyticalServer/ws?wsdl
Java-код:
Строки «user» и «pass» необходимо заменить реальными значениями.
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()); } } }