Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/RiverServiceImpl.java @ 1425:bc06a671ef60
Removed the URL parameter from service calls. The service
implementations read the URL from the web.xml config file now.
flys-client/trunk@3367 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 08 Dec 2011 09:12:27 +0000 |
parents | ab8eb2f544f2 |
children | 2867a0192aed |
comparison
equal
deleted
inserted
replaced
1424:8974e220b193 | 1425:bc06a671ef60 |
---|---|
46 /** The error message key that is thrown if an error occured while reading | 46 /** The error message key that is thrown if an error occured while reading |
47 * the supported rivers from server.*/ | 47 * the supported rivers from server.*/ |
48 public static final String ERROR_NO_RIVERS_FOUND = "error_no_rivers_found"; | 48 public static final String ERROR_NO_RIVERS_FOUND = "error_no_rivers_found"; |
49 | 49 |
50 | 50 |
51 public River[] list(String serverUrl, String locale) | 51 public River[] list(String locale) |
52 throws ServerException | 52 throws ServerException |
53 { | 53 { |
54 String url = getServletContext().getInitParameter("server-url"); | |
55 | |
54 Document doc = XMLUtils.newDocument(); | 56 Document doc = XMLUtils.newDocument(); |
55 | 57 |
56 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( | 58 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( |
57 doc, | 59 doc, |
58 ArtifactNamespaceContext.NAMESPACE_URI, | 60 ArtifactNamespaceContext.NAMESPACE_URI, |
59 ArtifactNamespaceContext.NAMESPACE_PREFIX); | 61 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
60 | 62 |
61 doc.appendChild(ec.create("action")); | 63 doc.appendChild(ec.create("action")); |
62 | 64 |
63 HttpClient client = new HttpClientImpl(serverUrl, locale); | 65 HttpClient client = new HttpClientImpl(url, locale); |
64 | 66 |
65 try { | 67 try { |
66 Document res = client.callService(serverUrl, "rivers", doc); | 68 Document res = client.callService(url, "rivers", doc); |
67 | 69 |
68 NodeList rivers = (NodeList) XMLUtils.xpath( | 70 NodeList rivers = (NodeList) XMLUtils.xpath( |
69 res, | 71 res, |
70 XPATH_RIVERS, | 72 XPATH_RIVERS, |
71 XPathConstants.NODESET, | 73 XPathConstants.NODESET, |