473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Web Service & Datetime data type

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
1 7918
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
6
by: eye5600 | last post by:
Is there a cure for the problems using databinding with a DateTimePicker? I find that a) sometimes it works, sometimes it doesn't, and b) it fails silently causing all databinding on the DataSet...
0
by: leslie_tighe | last post by:
Hello, I have a set of web services running on Java server that are exposed through axis 1.2.1. I can invoke these services in browser and through a java test client. However, when I try to...
4
by: leslie_tighe | last post by:
Hello, I have a webservice running on a J2EE server created with Axis 1.2.. I have a client that I am building in .net that needs to consume this webserivce and am having a bit of trouble. I have...
3
by: asanford | last post by:
I want to create a web service that allows the caller to pass a DateTime to the web service (that is, create a web method such as void MyWebMethod(DateTime dt).) However, I want to be able to...
0
by: vijayalakshmi.venkataraman | last post by:
Hello, I have a .NET client that accesses a Java webservice. Let me first say that the client stub I got generated from the wsdl was incomplete and had to make changes to it manually to make it...
2
by: craig.wagner | last post by:
I have an element in my schema defined as follows: <xs:element name="BillingDate" type="xs:dateTime" nillable="true" minOccurs="0"/> I use the schema to validate incoming documents using an...
0
by: JohnP | last post by:
Hi all Does anyone know the best way to get feedback from a Windows Service? I have written a Windows service which uses a class library (a DLL) which has a timer which does some operations...
8
by: Lemune | last post by:
Hi, I'm developing window service application on C# 2005. The service is to read a new excel file on certain directory, and process it to database. The service work find on XP. But when I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.