Date Time format Isuue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Date Time format Isuue

Post by RK72 »

Hi,
I am passing a value '2011-05-05 08:00:00' to a column in a target and that column in the web service has a date time format. If i am passing the above value it is throwing an exception that it does not match the format. What data type should be kept to pass that value to web service which has date time format.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What display format does the web service expect the date to be in? DataStage will have to format the date to a string display format that the web service is configured to accept.
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

When i passed the date '2011-05-05' to a another column which has date as datatype it has been passed successfully. But when i am passing '2011-05-05 08:00:00' which has date time as datatype it is throwing an exception. Before when i passed only '08:00:00' to that column which has date time as data type it is passing successfully and when data seen in web service it is showing as '2011-11-15 08:00:00' as it is adding today's date as default date with the specified time.
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

The vendor needs this format '2011-05-05 08:00:00' who has web service which has date time as data type. So what should i do to pass that value through web service with the above format.
bfennell
Participant
Posts: 6
Joined: Fri Nov 09, 2012 12:32 pm

Re: Date Time format Isuue

Post by bfennell »

Each column within a table definition can have a data element assigned to it. Make sure you are using Timestamp and not Time as the data element type (see the DataStage Director Help menu, look for "Data Elements" and "Built-In Data Elements").

Brian Fennell
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What "exception" message are you getting?
RK72
Participant
Posts: 154
Joined: Wed Sep 29, 2010 4:10 pm

Post by RK72 »

This is the message i am getting with xml message envelope:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:programRequestInfo. The InnerException message was &apos;There was an error deserializing the object of type Conisus.Integration.DTO.ProgramRequest. The value &apos;2011-05-05 05:00:00&apos; cannot be parsed as the type &apos;DateTime&apos;.&apos;. Please see InnerException for more details.</faultstring></s:Fault></s:Body></s:Envelope>
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What is the display format use by your web service? You should convert your timestamp data type to a string within datastage using that display format so that the webapp can parse it.
Post Reply