describeNamedLayers

Description

This operation takes a list of layers as input in the request and returns the description of those layers.

Messages

The following table lists the request and response messages for the describeNamedLayers operation.

Click on a message name to get more information about the message.

Message Description
DescribeNamedLayersRequest The request message for the describeNamedLayers operation.
DescribeNamedLayersResponse The response message for the describeNamedLayers operation.

Examples

Sample SOAP request:
<?xml version="1.0"?>   
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:v1="http://www.mapinfo.com/midev/service/mapping/v1">   
       <S:Header/>   
       <S:Body>   
              <v1:DescribeNamedLayersRequest>   
                <v1:NamedLayerList> 
                     <v1:NamedLayer>/Samples/NamedLayers/LayerWithStyle</v1:NamedLayer>  
                     <v1:NamedLayer>/Samples/NamedLayers/LayerWithStyles</v1:NamedLayer>  
                     <v1:NamedLayer>/Samples/NamedLayers/LayerWithTable</v1:NamedLayer>  
                  </v1:NamedLayerList> 
              </v1:DescribeNamedLayersRequest>   
       </S:Body>   
</S:Envelope>

Sample SOAP response:

The response includes the renderability of the layer as true or false, depending on the visibility setting for the layer. This is in contrast to a RenderMapRequest in which the visbility settings in the layers are ignored.

Note that Spectrum Spatial returns an error as part of the response if it cannot find a resource.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<DescribeNamedLayersResponse xmlns="http://www.mapinfo.com/midev/service/mapping/v1" xmlns:ns2="http://www.mapinfo.com/midev/service/mappingcommon/v1" xmlns:ns3="http://www.mapinfo.com/midev/service/table/v1" xmlns:ns4="http://www.mapinfo.com/midev/service/style/v1" xmlns:ns5="http://www.mapinfo.com/midev/service/featurecollection/v1" xmlns:ns6="http://www.mapinfo.com/midev/service/geometries/v1" xmlns:ns7="http://www.mapinfo.com/midev/service/theme/v1" xmlns:ns8="http://www.mapinfo.com/midev/service/common/v1" xmlns:ns9="http://www.mapinfo.com/midev/service/units/v1">
		    <DescribedNamedLayerList>
			<DescribedNamedLayer>
			    <Name>/Samples/NamedLayers/LayerWithStyle</Name>
			    <Layer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FeatureLayer" renderable="true" description="USA Capitals">
				    <ns3:Table xsi:type="ns3:NamedTable" name="/Samples/NamedTables/USA_CAPS"/>
				<ThemeList>
				    <ns7:Theme xsi:type="ns7:OverrideTheme">
				        <ns4:Style xsi:type="ns4:NamedStyle" name="/Samples/NamedStyles/CompositeStyle1"/>
				    </ns7:Theme>
				</ThemeList>
			    </Layer>
			</DescribedNamedLayer>
			<DescribedNamedLayer>
			    <Name>/Samples/NamedLayers/LayerWithStyles</Name>
				<ErrorMessage>RepositoryEx_ResourceNotFound: Resource was not found - /Samples/NamedLayers/LayerWithStyles</ErrorMessage>
			</DescribedNamedLayer>
			<DescribedNamedLayer>
			    <Name>/Samples/NamedLayers/LayerWithTable</Name>
				<Layer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FeatureLayer" renderable="true" description="United States">
				    <ns3:Table xsi:type="ns3:NamedTable" name="/Samples/NamedTables/USA"/>
				</Layer>
			</DescribedNamedLayer>
                    </DescribedNamedLayerList>
		</DescribeNamedLayersResponse>
	</soap:Body>
</soap:Envelope>
Sample SOAP stub for Java:
package mapping.sample;

import mapping.utility.Preference;
import mapping.utility.PrintMappingResponse;

import com.mapinfo.midev.service.mapping.v1.DescribeNamedLayersRequest;
import com.mapinfo.midev.service.mapping.v1.DescribeNamedLayersResponse;
import com.mapinfo.midev.service.mapping.ws.v1.MappingServiceInterface;
import com.mapinfo.midev.service.mapping.ws.v1.ServiceException;

public class DescribeNamedLayers {

	private static DescribeNamedLayersRequest createDescribeNamedLayersRequest()
			throws Exception {
		DescribeNamedLayersRequest request = new DescribeNamedLayersRequest();
		request.getNamedLayer().add("/Samples/NamedLayers/LayerWithTableRangeTheme");
		request.getNamedLayer().add("/Samples/NamedLayers/WorldFeatureLayer");
		request.getNamedLayer().add("/DoesNotExist");
		return request;
	}

	public static void main(String[] args) {
		try {
			MappingServiceInterface mapping = Preference.getServiceinterface();
			DescribeNamedLayersRequest request = createDescribeNamedLayersRequest();
			DescribeNamedLayersResponse response = mapping.describeNamedLayers(request);
			PrintMappingResponse.printDescribeNamedLayersResponse(response);
		} catch (ServiceException se) {
			PrintMappingResponse.printError(se);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

				
Sample SOAP stub for .NET:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// FaultException
using System.ServiceModel;
using MappingSamples.MappingService;

namespace MappingSamples
{
    // This shows how to find information of the named layers that exist on the server.
    class DescribeNamedLayers
    {
        static void Main(string[] args)
        {
            try
            {
                // create the client to communicate to the service
                MappingServiceInterfaceClient client = Preference.getServiceInterface();

                // create the DescribeNamedLayerRequest.
                DescribeNamedLayersRequest request = createDescribeNamedLayersRequest();

                // call the DescribeNamedLayer function.
                DescribeNamedLayersResponse response = client.describeNamedLayers(request);
                Console.WriteLine("Layer information:");
                int count = 0;
                foreach(Layer layer in response.Layer){
                    count++;
                    Console.WriteLine("Layer [" + count + "] :");
                    PrintUtils.printLayer(layer);
                }
                if (response.Layer == null)
                {
                    Console.WriteLine("No Layers described.");
                }
            }
            catch (FaultException<MapInfoDeveloperException> ee)
            {
                String s = ee.Message;
                Console.Out.WriteLine("Service Error returned: " + s);
            }
            catch (Exception ex)
            {
                String e = ex.ToString();
                Console.Out.WriteLine("Error: " + ex.ToString());
            }
            Console.Read();
        }

        // This creates a DescribeNamedLayersRequest.
        private static DescribeNamedLayersRequest createDescribeNamedLayersRequest()
        {
            // create the DescribeNamedLayersRequest
            DescribeNamedLayersRequest req = new DescribeNamedLayersRequest();
            req.NamedLayer = new string[2];
            req.NamedLayer[0] = "/Samples/NamedLayers/UK_REGNS_Layer";
            req.NamedLayer[1] = "/Samples/NamedLayers/WorldFeatureLayer";            

            return req;
        }
    }
}