File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -241,15 +241,27 @@ void QgsRequestHandler::parseInput()
241
241
setupParameters ();
242
242
243
243
QDomElement docElem = doc.documentElement ();
244
- if ( docElem.hasAttribute ( QStringLiteral ( " version" ) ) )
245
- {
246
- mRequest .setParameter ( QStringLiteral ( " VERSION" ), docElem.attribute ( QStringLiteral ( " version" ) ) );
247
- }
248
- if ( docElem.hasAttribute ( QStringLiteral ( " service" ) ) )
244
+ // the document element tag name is the request
245
+ mRequest .setParameter ( QStringLiteral ( " REQUEST" ), docElem.tagName () );
246
+ // loop through the attributes which are the parameters
247
+ // excepting the attributes started by xmlns or xsi
248
+ QDomNamedNodeMap map = docElem.attributes ();
249
+ for ( int i = 0 ; i < map.length () ; ++i )
249
250
{
250
- mRequest .setParameter ( QStringLiteral ( " SERVICE" ), docElem.attribute ( QStringLiteral ( " service" ) ) );
251
+ if ( map.item ( i ).isNull () )
252
+ continue ;
253
+
254
+ QDomNode attrNode = map.item ( i );
255
+ QDomAttr attr = attrNode.toAttr ();
256
+ if ( attr.isNull () )
257
+ continue ;
258
+
259
+ QString attrName = attr.name ();
260
+ if ( attrName.startsWith ( " xmlns" ) || attrName.startsWith ( " xsi:" ) )
261
+ continue ;
262
+
263
+ mRequest .setParameter ( attrName.toUpper (), attr.value () );
251
264
}
252
- mRequest .setParameter ( QStringLiteral ( " REQUEST" ), docElem.tagName () );
253
265
mRequest .setParameter ( QStringLiteral ( " REQUEST_BODY" ), inputString );
254
266
}
255
267
}
You can’t perform that action at this time.
0 commit comments