Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't understand error at47-getcapabilities-layer-style-legend-url #618

Closed
pdorio opened this issue Sep 29, 2021 · 11 comments
Closed

I can't understand error at47-getcapabilities-layer-style-legend-url #618

pdorio opened this issue Sep 29, 2021 · 11 comments
Labels
deployed in reference validator Solution deployed in production non-breaking change The change makes tests less restrictive and it has no impact on resources already tested
Milestone

Comments

@pdorio
Copy link

pdorio commented Sep 29, 2021

I try to validate my WMS service, but it fails on: at47-getcapabilities-layer-style-legend-url

https://inspire.ec.europa.eu/validator/test-reports/details.html?id=EID29b2b41d-eda1-43a3-a3fb-fa87fb8feed5

This is my service:
https://demo-geoservices8.civis.bz.it/geoserver/p_bz-Inspire/ows?service=wms&version=1.3.0&request=GetCapabilities&language=eng

Each style contains LegendUrl and the URL is valid

Can someone help me?
Regards

@project-bot project-bot bot added this to To do in Validator issues Sep 29, 2021
@pdorio
Copy link
Author

pdorio commented Oct 11, 2021

can someone help me?

@carlospzurita
Copy link
Contributor

Dear @pdorio

Sorry for the delay on our response. We are going to check the xPath of this ETS and its definition on the ATS, and see if the GetCapabilities document is compliant with the Abstract Test Suite in order to fix the implementation.

KInd regards.

@dperezBM
Copy link
Collaborator

Dear @pdorio,

We updated our staging instance. We added a more specific error message to help users to have a better understanding of what is not compliant. Could you please provide us feedback about this?

Thank you and best regards.

@dperezBM dperezBM assigned pdorio and unassigned carlospzurita Nov 18, 2021
@dperezBM dperezBM added ready for testing Solution provided to reporter or developed & deployed in staging (or beta), waiting for testing and removed under development labels Nov 18, 2021
@project-bot project-bot bot moved this from In progress to Staging: for acceptance in Validator issues Nov 18, 2021
@grigoriouelena
Copy link

grigoriouelena commented Nov 26, 2021

Hello everyone,

I used the staging instance to test a WMS. The aformentioned test fails for my resource also, because the /Layer/Style/LegendURL/Format is not 'application/xml', as expected by the validator, but image/png.

Looking for more information on this requirement, I see in the test method that the test should check if the legend is a valid image and not a specific format.

I am wondering whether the test is too strict, since I was not able to find any sort of requirement for a specific format of the legend graphic.

My resource is: http://beta.geoportal.ypen.gr/geoserver/aqd-wms/ows?service=WMS&version=1.3.0&request=GetCapabilities
and the legend graphic is here: http://beta.geoportal.ypen.gr/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.3.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=aqd-wms:AM.AirQualityManagementZone

Thank you in advance,

Elena

@pdorio
Copy link
Author

pdorio commented Nov 29, 2021

@dperezBM I tested the WMS again and I still don't understand the problem

Here my WMS getcapabilities

Here my report result

i obtain the following error at the same point: at47-getcapabilities-layer-style-legend:

def tc = testRunner.testCase.testSuite.project.testSuites["GetCapabilities_Operation"].testCases["initial-testcase"];
def response = tc.getTestStepByName("http-request").getPropertyValue("Response");
def capabilities = new XmlSlurper(false, true).parseText(response);

testRunner.testCase.setPropertyValue('language', '');
testRunner.testCase.setPropertyValue('legendEndpoint', '');
def defaultLanguage = capabilities.Capability.ExtendedCapabilities.SupportedLanguages.DefaultLanguage.Language.toString();
def supportedLanguages = [];
supportedLanguages << capabilities.Capability.ExtendedCapabilities.SupportedLanguages.DefaultLanguage.Language;
for (x in capabilities.Capability.ExtendedCapabilities.SupportedLanguages.SupportedLanguage){
	supportedLanguages << x.Language;
}

def tsGetCapabilities = testRunner.testCase.testSuite.project.testSuites["GetCapabilities_Operation"].testCases["at47-getcapabilities-layer-style-legend-url"].getTestStepByName('http-getcapabilities-specific-language');
def tsGetLegend = testRunner.testCase.testSuite.project.testSuites["GetCapabilities_Operation"].testCases["at47-getcapabilities-layer-style-legend-url"].getTestStepByName('http-getlegend');

for (x in supportedLanguages){
	testRunner.testCase.setPropertyValue('language', x.toString());
	tsGetCapabilities.setDisabled(false);
	tsGetCapabilities.run(testRunner, context);
	capabilitiesLanguaged = new XmlSlurper(false, true).parseText(tsGetCapabilities.getPropertyValue("Response"));

	def layers = capabilities.Capability.depthFirst().findAll{it.name()=='Layer'};
	layers.each{layer ->
		def styles = layer.Style;
		styles.each{style ->
			if(style.LegendURL.size() == 1){
				if(style.LegendURL.OnlineResource.size() != 1){
					String[] assertParams = ['element', 'Layer/Style/LegendURL/OnlineResource'];
					throw new TranslatableAssertionError('TR.multiplicityShallBeOne', assertParams);
				}
				if(style.LegendURL.OnlineResource.@'xlink:href'.toString().length() != 0){
					testRunner.testCase.setPropertyValue('legendEndpoint', style.LegendURL.OnlineResource.@'xlink:href'.toString());
					tsGetLegend.setDisabled(false);
					tsGetLegend.run(testRunner, context);
					if(tsGetLegend.testRequest.response.responseHeaders.get('Content-Type')[0] != style.LegendURL.Format.toString()){
						throw new TranslatableAssertionError("TR.invalidLegendFormat");
					}
				}
				else{
					String[] assertParams = ['element', 'Layer/Style/LegendURL/OnlineResource/@xlink:href'];
					throw new TranslatableAssertionError('TR.valueShallNotBeEmpty', assertParams);
				}
			}
			else if(style.LegendURL.size() != 0){
				String[] assertParams = ['element', 'Layer/Style/LegendURL'];
				throw new TranslatableAssertionError('TR.multiplicityShallBeZeroOrOne', assertParams);
			}
		}
	}
}
tsGetCapabilities.setDisabled(true);
tsGetLegend.setDi

@fabiovinci
Copy link
Collaborator

Dear @pdorio,

looking at the WMS of your last comment, it seems that in the LegendURL elements the WMS is missing.

For instance, this URL (https://geoservices8.civis.bz.it/geoserver/p_bz-Inspire/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&layer=AD.Address) generates the following exception:

<ows:Exception exceptionCode="MissingParameterValue" locator="version">
<ows:ExceptionText>Could not determine version</ows:ExceptionText>
</ows:Exception>

If you add the parameter version=1.3, the response is OK:

image

This generates the error in the "at47-getcapabilities-layer-style-legend" test.

Could you please verify your implementation and testing again?

@fabiovinci fabiovinci added user-to-fix Problem is present on user side and removed ready for testing Solution provided to reporter or developed & deployed in staging (or beta), waiting for testing labels Mar 18, 2022
@fabiovinci fabiovinci moved this from Staging: for acceptance to In progress in Validator issues Mar 18, 2022
@fabiovinci fabiovinci removed this from In progress in Validator issues Mar 18, 2022
@fabiovinci
Copy link
Collaborator

Dear @pdorio,

please note that the version parameter is not mandatory for a GetLegendGraphic request, but your server should reply considering the default one (e.g. https://msdi2.data.gov.mt/deegree/services/wms?request=GetLegendGraphic&service=WMS&layer=AM.StrategicLandUseDesignations&style=AM.StrategicLandUseDesignations&format=image/png).

We will modify the error messagge in order to better clarify that the response of the GetLegendGraphic request generates an exception.

@fabiovinci fabiovinci assigned dperezBM and unassigned pdorio Mar 22, 2022
@fabiovinci fabiovinci added under development and removed user-to-fix Problem is present on user side labels Mar 22, 2022
@fabiovinci fabiovinci added this to In progress in Validator issues Mar 22, 2022
@pdorio
Copy link
Author

pdorio commented Mar 23, 2022

@fabiovinci thank you for modifying the error message.

I know that the problem is generated by an issue of the software:
https://osgeo-org.atlassian.net/jira/core/projects/GEOS/issues/GEOS-10336

@arantzaetxebarria
Copy link
Collaborator

Dear @fabiovinci

We have modified the error message and it is ready in staging environment where you can check it.

Note: With the changes made during this issue, this one 703 has also been solved.

Regards

@arantzaetxebarria arantzaetxebarria added the ready for testing Solution provided to reporter or developed & deployed in staging (or beta), waiting for testing label Mar 31, 2022
@project-bot project-bot bot moved this from In progress to Staging: for acceptance in Validator issues Mar 31, 2022
@fabiovinci
Copy link
Collaborator

Deat @arantzaetxebarria,

the fix is ok for me.

@pdorio, Now the error message is "The legend format is invalid. The validator is expecting 'image/png', but the defined legend format is 'application/xml'. Please, review your code and try again.".

We think it is more understandable now, you confirm?

@fabiovinci fabiovinci added this to the 2022.2 milestone Mar 31, 2022
@fabiovinci fabiovinci removed their assignment May 24, 2022
@fabiovinci
Copy link
Collaborator

Dear @pdorio,

Do you confirm that the error message is clearer now?
Thank you

@fabiovinci fabiovinci added solved Solution developed and accepted, not yet deployed non-breaking change The change makes tests less restrictive and it has no impact on resources already tested and removed ready for testing Solution provided to reporter or developed & deployed in staging (or beta), waiting for testing labels Jun 10, 2022
@fabiovinci fabiovinci moved this from Staging: for acceptance to Staging: in release planning in Validator issues Jun 10, 2022
@fabiovinci fabiovinci added deployed in reference validator Solution deployed in production and removed solved Solution developed and accepted, not yet deployed labels Jun 22, 2022
@project-bot project-bot bot moved this from Staging: in release planning to Production: latest release in Validator issues Jun 22, 2022
@fabiovinci fabiovinci removed this from Production: latest release in Validator issues Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed in reference validator Solution deployed in production non-breaking change The change makes tests less restrictive and it has no impact on resources already tested
Projects
None yet
Development

No branches or pull requests

6 participants