comparison flys-client/src/main/java/de/intevation/flys/client/server/DistanceInfoServiceImpl.java @ 229:924da6695800

Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient. flys-client/trunk@1681 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 14 Apr 2011 07:53:01 +0000
parents 7523faf567e5
children d9fc58e30a53
comparison
equal deleted inserted replaced
228:bbe32496dc84 229:924da6695800
36 "error_no_distanceinfo_found"; 36 "error_no_distanceinfo_found";
37 37
38 public static final String XPATH_DISTANCES = "art:distances/art:distance"; 38 public static final String XPATH_DISTANCES = "art:distances/art:distance";
39 39
40 40
41 public DistanceInfoObject[] getDistanceInfo(String url, String river) 41 public DistanceInfoObject[] getDistanceInfo(
42 String url,
43 String locale,
44 String river)
42 throws ServerException 45 throws ServerException
43 { 46 {
44 System.out.println("DistanceInfoServiceImpl.getDistanceInfo"); 47 System.out.println("DistanceInfoServiceImpl.getDistanceInfo");
45 48
46 Document doc = XMLUtils.newDocument(); 49 Document doc = XMLUtils.newDocument();
54 57
55 riverEl.setTextContent(river); 58 riverEl.setTextContent(river);
56 59
57 doc.appendChild(riverEl); 60 doc.appendChild(riverEl);
58 61
59 HttpClient client = new HttpClientImpl(url); 62 HttpClient client = new HttpClientImpl(url, locale);
60 63
61 try { 64 try {
62 Document result = client.callService(url, "distanceinfo", doc); 65 Document result = client.callService(url, "distanceinfo", doc);
63 66
64 System.out.println("Extract distance info objects now."); 67 System.out.println("Extract distance info objects now.");

http://dive4elements.wald.intevation.org