Select to view content in your preferred language

WMS layer request fails due to decimal separator

1375
8
11-29-2010 12:06 PM
BjørnarSundsbø
Deactivated User
Hi

I try to use WmsLayer to display (obviosly) an image from a WMS service. This fails, with no image being presented. Thanks to Fiddler2, I was able to find out that the problem was invalid request for BBOX where decimal points were sent using a comma instead of a period. I use a system with Norwegian culture setting. Changing the application to use en-US, I got it working. The problem is that I can't change the culture for the whole application as that will lead to some unexpected issues for the user.

Any suggestions for a bugfix, and perhaps a temporary fix? I assume the WMS specifications expects period as the decimal separator, so perhaps this could be forced to use a period?

Bjørnar Sundsbø
0 Kudos
8 Replies
JenniferNery
Esri Regular Contributor
Thank you for reporting this. You must be using WMS service that is lower than v1.3. We'll try to get it fixed in future releases.

What you can do is get the source code for Toolkit.DataSources from http://esrisilverlight.codeplex.com/releases/view/39795

In the Wms.cs file, GetUrl method, line# 426
mapURL.AppendFormat("&bbox={0},{1},{2},{3}", extent.XMin, extent.YMin, extent.XMax, extent.YMax);

need to be replaced with:
 mapURL.AppendFormat(CultureInfo.InvariantCulture,
                        "&bbox={0},{1},{2},{3}", extent.XMin, extent.YMin, extent.XMax, extent.YMax);
0 Kudos
BjørnarSundsbø
Deactivated User
Jennifer,

I'm currently building against .NET 3.5, and compiling the toolkit to that version gives me some problems with VisualStateGroup and State manager not being available. This makes sense, though I can't think of how to build it to target 3.5.

Also, based on the numbers of doubles being parsed, I need to pass in InvariantCulture to all the places a double is parsed. Before I can do that, I guess I have to overcome the VisualStateManager issues. Any suggestions?
0 Kudos
JenniferNery
Esri Regular Contributor
If you are working with API v1.2, you can download previous releases: http://esrisilverlight.codeplex.com/releases/view/39794
0 Kudos
BjørnarSundsbø
Deactivated User
Jennifer,

Sorry, I thought I mention the version I'm using. I'm on API 2.1 RC.
0 Kudos
JenniferNery
Esri Regular Contributor
Oh. The source code for Toolkit v2.1 will be available as soon as v2.1 Final is made public. It will be found in the same location. I'm sorry you have to wait a little bit. It should be soon though.
0 Kudos
BjørnarSundsbø
Deactivated User
😞

Thank you for being so active in the forums. From old experiences with the old ArcObjects forums with almost no questions being answered, it is great to be able to get help from the team developing the product in such a short time.

Best regards,

Bjørnar Sundsbø
0 Kudos
BjørnarSundsbø
Deactivated User
Thank you for reporting this. You must be using WMS service that is lower than v1.3. We'll try to get it fixed in future releases.


Have you reported this to your issue tracker? I checked the December release, and this issue had not been resolved there.
0 Kudos
JenniferNery
Esri Regular Contributor
Yes, it's on our list. The bug is not fixed for v2.1 because we were on code-freeze when we learned about this.
0 Kudos