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()
241241 setupParameters ();
242242
243243 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 )
249250 {
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 () );
251264 }
252- mRequest .setParameter ( QStringLiteral ( " REQUEST" ), docElem.tagName () );
253265 mRequest .setParameter ( QStringLiteral ( " REQUEST_BODY" ), inputString );
254266 }
255267 }
You can’t perform that action at this time.
0 commit comments