GOV/Webservice/Java: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
(Syntaxhighlight) |
||
Zeile 1: | Zeile 1: | ||
== Position setzen == | == Position setzen == | ||
So setzt man die Position eines Ortes: | So setzt man die Position eines Ortes: | ||
<java>import net.genealogy.gov.data.Position; | |||
import net.genealogy.gov.ws.*; | |||
public class GovClient { | |||
public static void main(final String[] args) throws Exception { | |||
String user = args[0]; | |||
String password = args[1]; | |||
String id = args[2]; | |||
double longitude = Double.parseDouble(args[3]); | |||
double latitude = Double.parseDouble(args[4]); | |||
ComplexServicePortType readClient = | |||
new ComplexServiceLocator().getComplexServiceHttpPort(); | |||
ChangeServicePortType writeClient = | |||
new ChangeServiceLocator().getChangeServiceHttpPort(); | |||
net.genealogy.gov.data.Object place = readClient.getObject(id); | |||
Position position = new Position(); | |||
position.setLat(latitude); | |||
position.setLon(longitude); | |||
place.setPosition(position); | |||
writeClient.saveObject(place, user, password); | |||
} | |||
}</java> | |||
Version vom 3. April 2007, 07:22 Uhr
Position setzen
So setzt man die Position eines Ortes: <java>import net.genealogy.gov.data.Position; import net.genealogy.gov.ws.*;
public class GovClient {
public static void main(final String[] args) throws Exception { String user = args[0]; String password = args[1]; String id = args[2]; double longitude = Double.parseDouble(args[3]); double latitude = Double.parseDouble(args[4]); ComplexServicePortType readClient = new ComplexServiceLocator().getComplexServiceHttpPort(); ChangeServicePortType writeClient = new ChangeServiceLocator().getChangeServiceHttpPort();
net.genealogy.gov.data.Object place = readClient.getObject(id); Position position = new Position(); position.setLat(latitude); position.setLon(longitude); place.setPosition(position);
writeClient.saveObject(place, user, password); }
}</java>