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

WFS 1.1.0 ExceptionReport response handling : QGIS looks for 'exceptionCode' but in specifications it's 'code' attribute #42196

Closed
Yolecomte opened this issue Mar 11, 2021 · 2 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! WFS data provider

Comments

@Yolecomte
Copy link

When using a WFS service that implements the version 1.1.0, if an exception occured the specs tells to return an xml which might looks like this (chapter 7.7):

<?xml version="1.0" ?> 
<ExceptionReport    version="1.1.0"    xmlns="http://www.opengis.net/ogc"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="owsExceptionReport.xsd">  
      <Exception code="999" locator="INSERT STMT 01">       
            <ExceptionText>parse error: missing closing tag for element wkbGeom</ExceptionText>    
      </Exception> 
</ExceptionReport>

We can see that the <Exception> tag can include a code attribute.

When QGIS receive such a response from WFS service after something went wrong, it seems that it looks for an exceptionCode attribute.

here in current master :

.arg( exception.attribute( QStringLiteral( "exceptionCode" ), tr( "missing" ) ),
)

Not sure if there is a problem in QGIS or if I misunderstand the mentionned part of code but with that behavior we always get a missing code in client gui error dialog .

@Yolecomte Yolecomte added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Mar 11, 2021
@elpaso
Copy link
Contributor

elpaso commented Mar 11, 2021

@Yolecomte looks like an easy fix, it's probably enough to check for the code in case of version 1.1

@Yolecomte
Copy link
Author

Yolecomte commented Mar 11, 2021

@elpaso Thank's for quick answer.

Actually, even in version 1.0.0 it seems that we can send a code attribute from the specs. The difference is in 1.0.0 the first tag is <ServiceExceptionReport> and we fall back here in QGIS code (no attribute are checked and you only get the text message):

if ( exceptionElem.tagName() == QLatin1String( "ServiceExceptionReport" ) )

Anyhow, nothing critical here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! WFS data provider
Projects
None yet
Development

No branches or pull requests

3 participants