$e = new mb_notice("creating wmc from app: " . $app);
            $wmc->createFromApplication($app);
        }
    } else {
        $e = new mb_notice("loading from session WMC disabled in loadwmc or no session WMC set.");
        $e = new mb_notice("creating wmc from app: " . $app);
        $wmc->createFromApplication($app);
    }
} catch (Exception $e) {
    $e = new mb_notice("creating wmc from app: " . $app);
    $wmc->createFromApplication($app);
}
//
// create new WMC with services from GET API
//
$wmcGetApi = WmcFactory::createFromXml($wmc->toXml());
$options = array();
if (Mapbender::session()->exists("addwms_showWMS")) {
    $options["show"] = intval(Mapbender::session()->get("addwms_showWMS"));
}
if (Mapbender::session()->exists("addwms_zoomToExtent")) {
    $options["zoom"] = !!Mapbender::session()->get("addwms_zoomToExtent");
}
$getParams = array("WMC" => getConfiguration("WMC"), "WMS" => getConfiguration("WMS"), "LAYER" => getConfiguration("LAYER"), "FEATURETYPE" => getConfiguration("FEATURETYPE"), "GEORSS" => getConfiguration("GEORSS"));
$getApi = new GetApi($getParams);
//
// WMC
//
$inputWmcArray = $getApi->getWmc();
if ($inputWmcArray) {
    foreach ($inputWmcArray as $input) {