MCPcopy Index your code
hub / github.com/MapServer/MapServer / msWCSException

Function msWCSException

mapwcs.c:136–183  ·  view source on GitHub ↗

/ msWCSException() */ /

Source from the content-addressed store, hash-verified

134/* msWCSException() */
135/************************************************************************/
136int 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() */

Callers 14

msWCSParseRequestFunction · 0.85
msWCSGetCapabilitiesFunction · 0.85
msWCSDescribeCoverageFunction · 0.85
msWCSGetCoverageBands10Function · 0.85
msWCSGetCoverageFunction · 0.85
msWCSDispatchFunction · 0.85
msWCSWriteFile20Function · 0.85
msWCSGetCapabilities20Function · 0.85
msWCSDescribeCoverage20Function · 0.85
msWCSGetCoverage20Function · 0.85

Calls 10

msOWSParseVersionStringFunction · 0.85
msWCSException20Function · 0.85
msWCSException11Function · 0.85
msOWSLookupMetadataFunction · 0.85
msIO_printfFunction · 0.85
msOWSPrintEncodeMetadataFunction · 0.85
msEncodeHTMLEntitiesFunction · 0.85
msOWSGetSchemasLocationFunction · 0.85
msFreeFunction · 0.85
msWriteErrorXMLFunction · 0.85

Tested by

no test coverage detected