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

fix WPS processVersion attribute retrieval during DescribeProcess request #794

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

fmigneault
Copy link
Contributor

@fmigneault fmigneault commented Aug 27, 2021

When a GetCapabilities response is obtained, attribute wps:processVersion of all process offerings are nested under wps:Process elements. This makes parsing of the "root element" as namespace wps for each process.

<wps:Capabilities service="WPS"
                  version="1.0.0"
                  xml:lang="en-US"
                  xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsGetCapabilities_response.xsd"
                  updateSequence="1">
    [...]
	<wps:ProcessOfferings>
		<wps:Process wps:processVersion="0.1">
			<ows:Identifier>raven</ows:Identifier>
			<ows:Title>
		</wps:Process>
 		[...]
	</wps:ProcessOfferings>	
	[...]
</wps:Capabilities>

On the other hand, the DescribeProcess response provides attribute wps:processVersion under element ProcessDescription of the retrieved process(es) (without wps namespace), making the "root element" namespace an empty string.

<wps:ProcessDescriptions xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsDescribeProcess_response.xsd"
                         service="WPS"
                         version="1.0.0"
                         xml:lang="en-US">
	<ProcessDescription wps:processVersion="0.1"
	                    storeSupported="true"
	                    statusSupported="true">
		<ows:Identifier>raven</ows:Identifier>
 		[...]
	</ProcessDescription>
</wps:ProcessDescriptions>

The Process class was instantiated by always picking the active namespace from the root element, whether it was wps or "", but wps:processVersion always has the wps namespace.

This PR resolves retrieval of processVersion attribute following a DescribeProcess request.

Ex before:

wps = WebProcessingService("<url>")
print([p.processVersion for p in wps.processes if p.identifier == "raven"])
# ['0.1']   # works because of 'wps:Process' 

process = wps.describeprocess("raven")
print(process.processVersion)
# None   # fails because of 'ProcessDescription' instead of 'wps:ProcessDescription'

With PR:

print(process.processVersion)
# "0.1"

@cehbrecht
Copy link
Contributor

test failures not related to this PR.

@cehbrecht cehbrecht added the wps label Aug 31, 2021
@cehbrecht cehbrecht merged commit 44d5916 into geopython:master Aug 31, 2021
@fmigneault fmigneault deleted the wps-process-version branch August 31, 2021 15:47
@fmigneault
Copy link
Contributor Author

@cehbrecht Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants