Hi Jens,
My windows 2003 production server has language/culture Us english.
When i consume my webservice remotely from there, the formating goes all
wrong.
Like Nicholas already pointed out, your best bet is probably to choose a
culture for your application and set that in web.config.
The reason you are seeing this change in cultures in your production server
is that (assuming you are using IIS as your web server) the so-called
regional settings are set on per-user basis. When IIS runs your web service,
it does so in the context of another user account, which you can configure
with the IIS Admin tool.
For a reference, you might also want to check this document about ASP.NET
application Worker Process Isolation Mode:
http://www.microsoft.com/technet/pro....mspx?mfr=true
And, in case you are totally unsure about the configuration on your
production server, create a simple .ASPX page that contains the following:
----------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<head runat="server">
<title>Who Am I?</title>
</head>
<body>
<h1>Who Am I?</h1>
<pre><%= GetCurrentUserInfo() %></pre>
</body>
</html>
----------------------------
And for the page.aspx.cs file, type in the following code:
----------------------------
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Security.Principal;
public partial class _Default : System.Web.UI.Page
{
public string GetCurrentUserInfo()
{
StringBuilder info = new StringBuilder();
WindowsIdentity currentUser = WindowsIdentity.GetCurrent();
info.Append("Username: "+currentUser.Name + "\r\n");
info.Append("SID: " + currentUser.User.Value + "\r\n");
return info.ToString();
}
}
----------------------------
At runtime, the GetCurrentUserInfo() method will report data similar to the
following:
----------------------------
Who Am I?
Username: SAPPHIRE\ASPNET
SID: S-1-5-21-2052711402-412623190-839572195-1021
----------------------------
Hope this helps!
--
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
ja***@removethis.dystopia.fi http://www.saunalahti.fi/janij/