32 const QDomNode header = doc.createProcessingInstruction( QStringLiteral(
"xml" ), QStringLiteral(
"version=\"1.0\" encoding=\"UTF-8\"" ) );
33 doc.appendChild( header );
35 QDomElement root = doc.createElement( QStringLiteral(
"ServerException" ) );
36 doc.appendChild( root );
37 root.appendChild( doc.createTextNode(
what() ) );
39 responseFormat = QStringLiteral(
"text/xml; charset=utf-8" );
40 return doc.toByteArray();
57 const QDomNode header = doc.createProcessingInstruction( QStringLiteral(
"xml" ), QStringLiteral(
"version=\"1.0\" encoding=\"UTF-8\"" ) );
58 doc.appendChild( header );
60 QDomElement root = doc.createElement( QStringLiteral(
"ServiceExceptionReport" ) );
61 root.setAttribute( QStringLiteral(
"version" ), mVersion );
62 root.setAttribute( QStringLiteral(
"xmlns" ), QStringLiteral(
"http://www.opengis.net/ogc" ) );
63 doc.appendChild( root );
65 QDomElement elem = doc.createElement( QStringLiteral(
"ServiceException" ) );
66 elem.setAttribute( QStringLiteral(
"code" ), mCode );
67 elem.appendChild( doc.createTextNode( mMessage ) );
68 root.appendChild( elem );
70 if ( !mLocator.isEmpty() )
72 elem.setAttribute( QStringLiteral(
"locator" ), mLocator );
75 responseFormat = QStringLiteral(
"text/xml; charset=utf-8" );
76 return doc.toByteArray();