I created and publish a layer using:
In the python script I will add relevant layers to the MXD to its respective group:
1. I created a layer from "QRA_Official_Plot_Plans" raster catalog.
2. Save the layer to layer file.
3. Rename the layer to "top_PlotP_VOPAK-S04"
4. Added in the layer into the group "Plot Plans" layer group.
Problem is the layer name in MXD file for the mentioned layer is not the same as what is reflected in ArcGIS REST Service JSON.
When I opened up the MXD, it shows "top_PlotP_VOPAK-S04" (as shown in TOC.png).
But when I go the JSON layer definition, it shows the Raster Catalog name where I queried the layer from (as shown in JSONLayerDefinitino.png).