By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

Web Service & Datetime data type

P: n/a
Hi all,

i have one problem with a method of an xml web service that use a datetime data type input variable, and may be all is caused by international settings.

The XML web service (localized in italy, with italian settings) have the following method:

MYXWS.MyMethod(input_var as datetime)

On my dev machine (localized in italy, with italian settings) i have created a web application that use the proxy class for call the XML wer service, and all work fine.

Code used MYXWS.MyMethod(now().Date)

When i upload the compiled web app on my production machine (localized in USA, with USA settings) when the web app (a webForm) use the proxy class that call the XML Web service i get from the XML Web service the following error:

Server was unable to process request. --> The conversion of a char data type
to a datetime data type resulted in an out-of-range datetime value

It seem that on dev machine the proxy class call the method using "dd/MM/yyyy" format (as italian settings), and on production machine use "MM/dd/yyyy" format.

I have already included in my web app the following code

in web config

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="it-IT" />

in webform

Dim myculture As System.Globalization.CultureInfo
myculture = New System.Globalization.CultureInfo("it-IT")
System.Threading.Thread.CurrentThread.CurrentCultu re = myculture
System.Threading.Thread.CurrentThread.CurrentUICul ture = myculture
But the problem is not solved.

Any idea??

Thank you

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>udmB9pSkCEOuHIp95SPjDQ==</Id>
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

I had a very similar problem with US and Irish dates. I corrected the
problem by adding by culture and uiCulture settings to both my client
application and my webservice application. So, inside your web.config on
both client and server, add the following attribute uiCulture="it-IT"

Let me know if that doesn't help. I've found the date time thing to be
tricky to get to grips with.

Tom

"M DL via .NET 247" wrote:
Hi all,

i have one problem with a method of an xml web service that use a datetime data type input variable, and may be all is caused by international settings.

The XML web service (localized in italy, with italian settings) have the following method:

MYXWS.MyMethod(input_var as datetime)

On my dev machine (localized in italy, with italian settings) i have created a web application that use the proxy class for call the XML wer service, and all work fine.

Code used MYXWS.MyMethod(now().Date)

When i upload the compiled web app on my production machine (localized in USA, with USA settings) when the web app (a webForm) use the proxy class that call the XML Web service i get from the XML Web service the following error:

Server was unable to process request. --> The conversion of a char data type
to a datetime data type resulted in an out-of-range datetime value

It seem that on dev machine the proxy class call the method using "dd/MM/yyyy" format (as italian settings), and on production machine use "MM/dd/yyyy" format.

I have already included in my web app the following code

in web config

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="it-IT" />

in webform

Dim myculture As System.Globalization.CultureInfo
myculture = New System.Globalization.CultureInfo("it-IT")
System.Threading.Thread.CurrentThread.CurrentCultu re = myculture
System.Threading.Thread.CurrentThread.CurrentUICul ture = myculture
But the problem is not solved.

Any idea??

Thank you

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>udmB9pSkCEOuHIp95SPjDQ==</Id>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.