= WMS Wrapper example = - source: https://lists.ms4w.com/pipermail/ms4w-users/2019-May/000343.html - note: likely solution is included in next !MapServer release ([[https://github.com/mapserver/mapserver/pull/5778/files#diff-127c91f36292dd4e75e861fb07c29f1f|diff]]) == SWIG !MapScript [ This is now working and is resolved :) ] == {{{ #!php $v) { $request->setParameter($k, $v); } $oMap->OWSDispatch($request); unset($oMap); $contenttype = strtolower(msIO_stripStdoutBufferContentType()); //Capabilities Request if ($contenttype == "application/vnd.ogc.wms_xml; charset=utf-8"){ header('Content-type: application/xml; charset=utf-8'); echo msIO_getStdoutBufferString(); } //getMap jpeg else if ($contenttype == 'image/jpeg'){ header('Content-type: image/jpeg'); echo msIO_getStdoutBufferBytes(); } ?> }}} == Old !MapScript == {{{ #!php $v) { $request->setParameter($k, $v); } $oMap->owsdispatch($request); $oMap->free(); unset($oMap); $contenttype = strtolower(ms_iostripstdoutbuffercontenttype()); //Capabilities Request if ($contenttype == "application/vnd.ogc.wms_xml; charset=utf-8"){ header('Content-type: application/xml; charset=utf-8'); echo ms_iogetstdoutbufferstring(); } //getMap jpeg else if ($contenttype == 'image/jpeg'){ header('Content-type: image/jpeg'); echo ms_iogetStdoutBufferBytes(); } ## reset handler and cleaup added msIO_resetHandlers(); msCleanup(); ?> }}}