33 const QDomNode header = doc.createProcessingInstruction( QStringLiteral(
"xml" ), QStringLiteral(
"version=\"1.0\" encoding=\"UTF-8\"" ) );
34 doc.appendChild( header );
36 QDomElement root = doc.createElement( QStringLiteral(
"ServerException" ) );
37 doc.appendChild( root );
38 root.appendChild( doc.createTextNode(
what() ) );
40 responseFormat = QStringLiteral(
"text/xml; charset=utf-8" );
41 return doc.toByteArray();
59 const QDomNode header = doc.createProcessingInstruction( QStringLiteral(
"xml" ), QStringLiteral(
"version=\"1.0\" encoding=\"UTF-8\"" ) );
60 doc.appendChild( header );
62 QDomElement root = doc.createElement( QStringLiteral(
"ServiceExceptionReport" ) );
63 root.setAttribute( QStringLiteral(
"version" ), mVersion );
64 root.setAttribute( QStringLiteral(
"xmlns" ), QStringLiteral(
"http://www.opengis.net/ogc" ) );
65 doc.appendChild( root );
67 QDomElement elem = doc.createElement( QStringLiteral(
"ServiceException" ) );
68 elem.setAttribute( QStringLiteral(
"code" ), mCode );
69 elem.appendChild( doc.createTextNode( mMessage ) );
70 root.appendChild( elem );
72 if ( ! mLocator.isEmpty() )
74 elem.setAttribute( QStringLiteral(
"locator" ), mLocator );
77 responseFormat = QStringLiteral(
"text/xml; charset=utf-8" );
78 return doc.toByteArray();