473,659 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ 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

<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" culture="it-IT" />

in webform

Dim myculture As System.Globaliz ation.CultureIn fo
myculture = New System.Globaliz ation.CultureIn fo("it-IT")
System.Threadin g.Thread.Curren tThread.Current Culture = myculture
System.Threadin g.Thread.Curren tThread.Current UICulture = myculture
But the problem is not solved.

Any idea??

Thank you

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

<Id>udmB9pSkCEO uHIp95SPjDQ==</Id>
Nov 21 '05 #1
1 7930
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

<globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8" culture="it-IT" />

in webform

Dim myculture As System.Globaliz ation.CultureIn fo
myculture = New System.Globaliz ation.CultureIn fo("it-IT")
System.Threadin g.Thread.Curren tThread.Current Culture = myculture
System.Threadin g.Thread.Curren tThread.Current UICulture = myculture
But the problem is not solved.

Any idea??

Thank you

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

<Id>udmB9pSkCEO uHIp95SPjDQ==</Id>

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6426
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 be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session = parsedreceipt;
6
6730
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 to fail with a error message. Help!
0
1676
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 consume them in VB .NET I get objects with nothing in them. Interestingly, if I call a webservice that returns a string, then it all works fine. I have pasted the wsdl file for review. Any suggestions would be greatly appreciated. I used the...
4
1972
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 pasted the wsdl below and have a created a class in VB.net by adding a web refrence to my project. What is odd is that I can successfully call methods that return a simple value like a string. I call also call methods that add an object....
3
8318
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 capture the TimeZone of the caller as well - but I don't want the interface to specify an xs:string as the method argument - I want it to use an xs:dateTime type argument. Now, I know when a DateTime structure is serialized into XML it becomes an...
0
1645
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 work to an extent. I generated a java client stub for the java web service and have been modifying my .NET client stub using the java client stub as a reference and things seemed to work fine until I got the following error. In my client...
2
9101
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 XmlValidatingReader in .NET 1.1. If the document contains the above element with no data, for example:
0
1500
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 every <xseconds. I'd like to be able to somehow get the current 'elapsed' seconds of the timer, with a view to displaying something on the service control manager program I have written. All seems to be OK (service works properly, as does the DLL and...
8
9372
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 install the application on Windows Server 2003, when i start the service it said: "The <my serviceon Local Computer started and then stop. Some service stop automatically if they have no work to do , for example ,
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2750
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 we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.