Revision 3604 trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wms/WMSProtocolHandler.java

View differences:

WMSProtocolHandler.java
287 287
    {
288 288
		String req = new String();
289 289
		String host = getHost();
290
//		if ((!host.endsWith("?"))&&(host.indexOf("?")==-1))			
291
//			req = req + getHost() + "?REQUEST=GetCapabilities&SERVICE=WMS&";
292
//		else
293
//		{
294
//			String symbol = (host.endsWith("&")) ? "" : "&";
295
//			req = req + getHost() + symbol + "REQUEST=GetCapabilities&SERVICE=WMS&";
296
//		}
297
		String symbol = (host.indexOf("?")==-1) ? "?" : "&";
298
		req = req + getHost() + symbol + "REQUEST=GetCapabilities&SERVICE=WMS&";
290

  
291
        String symbol;
292
        if (host.indexOf("?")==-1) 
293
            symbol = "?";
294
        else if (host.indexOf("?")!=host.length()-1)
295
            symbol = "&";
296
        else
297
            symbol = "";
298
        req = req + getHost() + symbol + "REQUEST=GetCapabilities&SERVICE=WMS&";
299 299
		req = req + "VERSION=" + getVersion();
300 300
		req += ("&EXCEPTIONS=XML");
301 301
		return req;
......
307 307
    private String buildGetFeatureInfoRequest(WMSStatus status, int x, int y)
308 308
    {
309 309
		String req = new String();
310
//		if (!host.endsWith("?"))
311
//			req = req + getHost() + "?REQUEST=GetFeatureInfo&SERVICE=WMS&";
312
//		else
313
//			req = req + getHost() + "REQUEST=GetFeatureInfo&SERVICE=WMS&";
314
		String symbol = (host.indexOf("?")==-1) ? "?" : "&";
310

  
311
        String symbol;
312
        if (host.indexOf("?")==-1) 
313
            symbol = "?";
314
        else if (host.indexOf("?")!=host.length()-1)
315
            symbol = "&";
316
        else
317
            symbol = "";
318
        
315 319
		req = req + getHost() + symbol + "REQUEST=GetFeatureInfo&SERVICE=WMS&";
316 320
		req = req + "QUERY_LAYERS="+Utilities.Vector2CS(status.getLayerNames()); 
317 321
		req = req + "&VERSION=" + getVersion() + "&";
......
332 336
    private String buildMapRequest(WMSStatus status)
333 337
    { 
334 338
		String req = new String();
335
//		if (!host.endsWith("?"))
336
//			req = req + getHost() + "?REQUEST=GetMap&SERVICE=WMS&";
337
//		else
338
//			req = req + getHost() + "REQUEST=GetMap&SERVICE=WMS&";
339
		String symbol = (host.indexOf("?")==-1) ? "?" : "&";
339

  
340
		String symbol;
341
        if (host.indexOf("?")==-1) 
342
            symbol = "?";
343
        else if (host.indexOf("?")!=host.length()-1)
344
            symbol = "&";
345
        else
346
            symbol = "";
340 347
		req = req + getHost() + symbol + "REQUEST=GetMap&SERVICE=WMS&";
341 348
		req = req + "VERSION=" + getVersion() + "&";
342 349
		req = req + getPartialQuery(status);

Also available in: Unified diff