/ msWCSException() */ /
| 134 | /* msWCSException() */ |
| 135 | /************************************************************************/ |
| 136 | int msWCSException(mapObj *map, const char *code, const char *locator, |
| 137 | const char *version ) |
| 138 | { |
| 139 | char *pszEncodedVal = NULL; |
| 140 | const char *encoding; |
| 141 | |
| 142 | if( version == NULL ) |
| 143 | version = "1.0.0"; |
| 144 | |
| 145 | #if defined(USE_LIBXML2) |
| 146 | if( msOWSParseVersionString(version) >= OWS_2_0_0 ) |
| 147 | return msWCSException20( map, code, locator, version ); |
| 148 | #endif |
| 149 | |
| 150 | if( msOWSParseVersionString(version) >= OWS_1_1_0 ) |
| 151 | return msWCSException11( map, code, locator, version ); |
| 152 | |
| 153 | encoding = msOWSLookupMetadata(&(map->web.metadata), "CO", "encoding"); |
| 154 | if (encoding) |
| 155 | msIO_printf("Content-type: application/vnd.ogc.se_xml; charset=%s%c%c", encoding,10,10); |
| 156 | else |
| 157 | msIO_printf("Content-type: application/vnd.ogc.se_xml%c%c",10,10); |
| 158 | |
| 159 | /* msIO_printf("Content-type: text/xml%c%c",10,10); */ |
| 160 | |
| 161 | msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), NULL, "wcs_encoding", OWS_NOERR, "<?xml version='1.0' encoding=\"%s\" ?>\n", "ISO-8859-1"); |
| 162 | |
| 163 | msIO_printf("<ServiceExceptionReport version=\"1.2.0\"\n"); |
| 164 | msIO_printf("xmlns=\"http://www.opengis.net/ogc\" "); |
| 165 | msIO_printf("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "); |
| 166 | pszEncodedVal = msEncodeHTMLEntities(msOWSGetSchemasLocation(map)); |
| 167 | msIO_printf("xsi:schemaLocation=\"http://www.opengis.net/ogc %s/wcs/1.0.0/OGC-exception.xsd\">\n", |
| 168 | pszEncodedVal); |
| 169 | msFree(pszEncodedVal); |
| 170 | msIO_printf(" <ServiceException"); |
| 171 | if (code) { |
| 172 | msIO_printf(" code=\"%s\"", code); |
| 173 | } |
| 174 | if (locator) { |
| 175 | msIO_printf(" locator=\"%s\"", locator); |
| 176 | } |
| 177 | msIO_printf(">"); |
| 178 | msWriteErrorXML(stdout); |
| 179 | msIO_printf(" </ServiceException>\n"); |
| 180 | msIO_printf("</ServiceExceptionReport>\n"); |
| 181 | |
| 182 | return MS_FAILURE; |
| 183 | } |
| 184 | |
| 185 | /************************************************************************/ |
| 186 | /* msWCSPrintRequestCapability() */ |
no test coverage detected