private CustomLayerInfos GetLayerInfos()
        {
            IMapServer3 mapServer = serverObjectHelper.ServerObject as IMapServer3;

            if (mapServer == null)
            {
                throw new Exception("Unable to access the map server.");
            }

            IMapServerInfo msInfo     = mapServer.GetServerInfo(mapServer.DefaultMapName);
            IMapLayerInfos layerInfos = msInfo.MapLayerInfos;
            int            c          = layerInfos.Count;

            CustomLayerInfos customLayerInfos = new CustomLayerInfos(Constants.SOENamespaceURI);

            for (int i = 0; i < c; i++)
            {
                IMapLayerInfo layerInfo = layerInfos.get_Element(i);

                CustomLayerInfo customLayerInfo = new CustomLayerInfo();
                customLayerInfo.Name   = layerInfo.Name;
                customLayerInfo.ID     = layerInfo.ID;
                customLayerInfo.Extent = layerInfo.Extent;

                customLayerInfos.Add(customLayerInfo);
            }

            return(customLayerInfos);
        }
        private void GetLayerInfos(IMessage reqMsg, IMessage respMsg)
        {
            //no input parameters expected in request

            CustomLayerInfos resultPropSet = GetLayerInfos();

            respMsg.Name         = "GetLayerInfosResponse";
            respMsg.NamespaceURI = Constants.SOENamespaceURI;
            respMsg.Parameters.AddObject("Result", resultPropSet);
        }