Select to view content in your preferred language

Legend : Invalid escape code encountered in a JSON string. (101)

927
3
04-06-2010 02:16 AM
hcgis
by
Deactivated User
i ve implemented the legend control and works perfectly in my local machine, but when i change the MapServiceSoapUrl to another service in my server machine it causes this error : Invalid escape code encountered in a JSON string. (101)

An other request, i want also implement the legend  with two cultures. is there a solution to change the layer names in the legend when i switch between the two cultures
thanks
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
This is likely a bug in the service sample. Could you look into what JSON is being sent? It's likely just a character in one of the strings (layername, description etc) that is not being correctly escaped.
0 Kudos
Sheng-TeTsai
Emerging Contributor
I encountered the same issue.  Can you guide me how to "look into what JSON is being sent"?

Thanks!
0 Kudos
Sheng-TeTsai
Emerging Contributor
OK, I fixed the issue.

I checked the inner exception and found the issue was at the corss-domain policy for SOAP services.  The content of my original cross-domain policy file was:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*"/>
</cross-domain-policy>

After I changed the content to:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*"/>
    <allow-http-request-headers-from domain="*" headers="*"/>

</cross-domain-policy>

the Legend function is working good.

Thanks,

Sheng-Te
0 Kudos