Currently in Geoserver, when I attached a style to a layer in publishing tab, the preview legend style image under "default style" shows a broken image display.

I also was unable to call it directly via URL getLegendGraphic. It only downloaded an empty WMS file.

The style is working fine when I use Geoserver preview layer.
Anybody had the solution for this problem?

The Geoserver instance version is 2.5.

Edited: Yes, after rechecked, the WMS indeed contains information:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1" >
    <ServiceException code="MissingParameterValue" locator="service">
        Could not determine service

the url:

  • what is in the "empty WMS" file - there should be some XML, please add the contents to your question
    – Ian Turton
    Nov 10, 2016 at 9:19
  • Also 2.5 is no longer supported - current stable version is 2.10 and maintained version is 2.9 so please upgrade and try again.
    – Ian Turton
    Nov 10, 2016 at 9:19
  • @iant I have to make use of what is provided since I do not have privilege to upgrade Geoserver currently. Nov 11, 2016 at 3:28

1 Answer 1


The error message is quite clear you have not specified the service you require GeoServer to use, or more simply you aren't making a valid request.

A getLegend request should look like:


There are many further options available that are well documented.

  • I have checked my request following the convention, the request should be valid, but again even in the Geoserver edit layer page -> publishing tab itself, the preview legend that should be appeared only show a broken image link. Nov 11, 2016 at 17:08
  • please add the actual URL you are using
    – Ian Turton
    Nov 11, 2016 at 17:44
  • I update the question to include the URL. Nov 13, 2016 at 15:48
  • It does not contain a service element like mine
    – Ian Turton
    Nov 13, 2016 at 15:50
  • Aah... I see.. the wms. thank you... still i wonder why the geoserver it self shown the broken link and when I inspect the source, also use similar url link as mine.. Anyway, thank you very much for the answer and I will add your answer as the correct answer. Nov 13, 2016 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.