150 |
150 |
QgsHttpTransaction http( request );
|
151 |
151 |
if ( !http.getSynchronously( result ) )
|
152 |
152 |
{
|
153 |
|
QMessageBox::critical( 0, tr( "Could not download capabilities document" ), http.errorString() );
|
|
153 |
QMessageBox::critical( 0, tr( "Error" ),
|
|
154 |
tr( "Could not download capabilities document" ) + http.errorString() );
|
154 |
155 |
return 1;
|
155 |
156 |
}
|
156 |
157 |
|
... | ... | |
158 |
159 |
QString capabilitiesDocError;
|
159 |
160 |
if ( !capabilitiesDocument.setContent( result, true, &capabilitiesDocError ) )
|
160 |
161 |
{
|
161 |
|
QMessageBox::critical( 0, tr( "Capabilities document is not valid" ), capabilitiesDocError );
|
|
162 |
QMessageBox::critical( 0, tr( "Error" ),
|
|
163 |
tr( "Capabilities document is not valid: " ) + capabilitiesDocError );
|
162 |
164 |
return 1;
|
163 |
165 |
}
|
164 |
166 |
|
165 |
|
QDomNodeList exlist = capabilitiesDocument.elementsByTagName( "ExceptionText" );
|
166 |
|
if ( exlist.length() )
|
|
167 |
QDomElement doc = capabilitiesDocument.documentElement();
|
|
168 |
if ( doc.tagName() == "ExceptionReport" )
|
167 |
169 |
{
|
168 |
|
QDomElement ex = exlist.at( 0 ).toElement();
|
169 |
|
QMessageBox::critical( 0, tr( "Error" ), ex.firstChild().nodeValue() );
|
|
170 |
QDomNode ex = doc.firstChild();
|
|
171 |
QString exc = ex.toElement().attribute("exceptionCode", "Exception");
|
|
172 |
QDomElement ext = ex.firstChild().toElement();
|
|
173 |
QMessageBox::critical( 0, tr( "Error" ),
|
|
174 |
exc + ": " + ext.firstChild().nodeValue() );
|
170 |
175 |
return 1;
|
171 |
176 |
}
|
172 |
177 |
|
173 |
|
|
174 |
|
|
175 |
178 |
//get the <FeatureType> elements
|
176 |
179 |
QDomNodeList featureTypeList = capabilitiesDocument.elementsByTagNameNS( WFS_NAMESPACE, "FeatureType" );
|
177 |
180 |
for ( unsigned int i = 0; i < featureTypeList.length(); ++i )
|