Hi Peppe, Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response.
javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://username:pas...@site.fi/cgi-bin/service1?&SERVICE=WMS&REQUEST=GetLegendGraphic&VERSION=1.1.1&FORMAT=image/png&WIDTH=16&HEIGHT=16&legend_options=bgColor:0xFFFFEE;dpi:100;fontAntiAliasing:true;forceLabels:on&LAYER=tukialueet at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at java.net.URL.openStream(Unknown Source) ... 42 more -Jukka Rahkonen- Giuseppe Aruta wrote: The plugin will be available on OJ 4474 Night Snapshot 2015-06-04 15:24 GMT+02:00 Giuseppe Aruta <giuseppe.ar...@gmail.com<mailto:giuseppe.ar...@gmail.com>>: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as "Show WMS Layer Legend". The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe
------------------------------------------------------------------------------
_______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel