I have an mxd file. Each time I share/publish a WMS service to the ArcGIS server as WMS, random numbers are added to the layer name. For example here is added number 8950 at the end of the <Name> tag. Even though the original name is down in the title and there is no number at the end. I pair these services with other services by layer name and need to prevent ArcGIS to add random numbers to the names and let them stay as they are.

<Layer queryable="1">
<![CDATA[ Povodeň z topiaceho sa snehu gc ]]>

I also checked the checkbox Use layer names from the map document.

I don't know what else to do to prevent this from happening...


After some research I still don't know why this happens, but a way to avoid this is to stop using diacritics in layer names as shown in the example.

When I changed the layer name in the mxd file to "povoden_z_topiaceho_sa_snehu_gc", the generated layer names are without numbers, so, to say, are OK. But why this happens I do not know in fact.

Also there was a problem querying the WMS by layer name where there was a space used in the layer name, so I also had to replace all the spaces by "_".

  • 1
    It is generally bad practice to use any spaces in layer names as this can be interpret by a system/environment as a list of strings instead of 1 string. So best practice is to always use "_". It might be due to some internal processes that special characters are differently translated. Could be that it only accepts ASCII symbols.
    – MarcM
    Oct 14 '20 at 13:38
  • The AG itself turns the spaces into "_" in the layer name, so I would expect it to work that way, but it doesn't work either way. Also it accepts the diacritics but then adds strange numbers. So I agree that it is a bad practice, but when it's allowed, it should be handled in the way, that it works. Adding ranbom numbers is pretty strange and unexpected behavior. (well we wanted to use the layer name as a layer name in the application without the need to store additional info in the app itself, that's why I used the diacritis. And to use the description for further description, not name.)
    – Mochi
    Oct 14 '20 at 15:49
  • 1
    Interesting that the diacritics caused it to add numbers. There must be some character mapping somewhere in the code for when non-ascii characters are used. I found this article which was about how Oracle handles diacritics, which shows that there are some ISO Latin decimal codes used, im guessing something similar is happening with the service generation in ArcGIS. docs.oracle.com/cd/E29584_01/webhelp/mdex_basicDev/src/…
    – nr_aus
    Mar 23 at 6:26
  • Yes, I thought so too. But the fact, that these numbers are "random" (somewhat random, I just didn't find any pattern) is curious too. Because I would expect them to be the same each time when some kind of ascii conversion happens. So when I use the same name for a layer, the number is different each time.... :)
    – Mochi
    Mar 23 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.