ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Datetime Validation

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Datetime Validation « View previous topic :: View next topic » 
Author Message
devil1998
PostPosted: Wed Nov 09, 2005 1:17 am    Post subject: Datetime Validation Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Hi,

I get an XML message with the following datetime:
'05-06-17T11:30:13+02:00'.
Unfortunately during the message set validation it makes from the year '05' the year '0005' - but it should be '2005' or it should be failed (because of only 2 digits for the year).

Any ideas?

thanks and regards
devil
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Nov 09, 2005 4:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I'd like to help, but I'll need a lot more detail about your scenario.
Quote:
during the message set validation it makes from the year '05' the year '0005'
I don't understand this sentence. Validation is a read-only operation, so it cannot change the value of your datetime element.

Quote:
but it should be '2005' or it should be failed (because of only 2 digits for the year).
That depends on how you defined that element in your message model, and whether you have enabled validation in your message flow. Why did you expect it to fail? What does yout message set definition look like?
Back to top
View user's profile Send private message
devil1998
PostPosted: Wed Nov 09, 2005 5:41 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

With message set validation I mean that I have in my flow an input node and in this input node it will validates the message against the message set.
And so the message has behind the input node this "new" date '0005-06-17T11:30:13+02:00'.
The date is declared as xsd:dateTime in the message set.

Do you understand what I try to explain ?
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Nov 09, 2005 6:33 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
And so the message has behind the input node this "new" date '0005-06-17T11:30:13+02:00'
How do you know? Are you looking at a trace of the message tree, the debugger, or the message on the output queue?
Quote:
Do you understand what I try to explain
I think I'm getting there . I still don't know exactly what you want to do, though. Can you give the following info:
- The purpose of your message flow,
- Exactly what you would like to see happening
- Do you really want message validation, or just message parsing
Back to top
View user's profile Send private message
devil1998
PostPosted: Thu Nov 10, 2005 12:55 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Sorry about my incomprehensible wording .

In my message flow I get in an EANUCCXML message, the input node should validate it against the MRM -CwXML Message set, in the flow we write the content of this message to a database and then we send the same EANUCCXML message out.

If I get a message in with the following creation date time:
<plan:replenishmentProposal creationDateTime="05-06-17T11:30:13+02:00" documentStatus="ORIGINAL" replenishmentProposalDocumentType="DELIVERY_PLAN" structureType="LOCATION_BY_ITEM" xsi:schemaLocation="urn:ean.ucc:2 ../Schemas/ReplenishmentProposalProxy.xsd">
it validates this content against the schema.
The result of the validation looks so:
<plan:replenishmentProposal creationDateTime="0005-06-17T11:30:13+02:00" documentStatus="ORIGINAL" replenishmentProposalDocumentType="DELIVERY_PLAN" structureType="LOCATION_BY_ITEM" xsi:schemaLocation="urn:ean.ucc:2 ../Schemas/ReplenishmentProposalProxy.xsd">
But it should be look so:
<plan:replenishmentProposal creationDateTime="2005-06-17T11:30:13+02:00" documentStatus="ORIGINAL" replenishmentProposalDocumentType="DELIVERY_PLAN" structureType="LOCATION_BY_ITEM" xsi:schemaLocation="urn:ean.ucc:2 ../Schemas/ReplenishmentProposalProxy.xsd">
or it should create an error because of an invalid datetime (because the year has only 2 digits).
The best result would be if it validates the year '05' to '2005' - but is this not possible we could take the error.

But in the moment the validation is really wrong for this date !

We really need the message validation in the input node.

Thank you!!!
Regards
devil
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Nov 10, 2005 3:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I've tried this on message broker v5, and I know what the problem is.
You need to change the 'DateTime Format' field in your message set. The one which you are using is the XML Schema default format ( yyyy-MM-dd'T'HH:mm:ssZZZ ). You need to remove the first two characters, so that it describes a two-digit year. ( yyyy-MM-dd'T'HH:mm:ssZZZ )

If you don't know how to do this, I can point you in the right direction.
Back to top
View user's profile Send private message
devil1998
PostPosted: Thu Nov 10, 2005 5:22 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

HEI it is WORKING now !!!!!! Thank you!

Unfortunately I have another problem for this...
I tried this in another flow as well and there it is working fine with year now !
But in this flow is a XML Transformation Node. In this node the EANUCCXML message will be transformed to an fixed length message with the help of a stylesheet. At the breakponit before this Transformation node I see that the year is still '2005'.But in the fixed length message behind the node the year is '05'.
From where does the node know, that the input year beforde the validation was '05' and why it takes '05'?

Can you help me with this problem as well?
THANKS
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Nov 10, 2005 5:30 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
the EANUCCXML message will be transformed to an fixed length message with the help of a stylesheet
So I would guess that the stylesheet is changing the year from 4 digits to 2. But I may be wrong.[/quote]
Back to top
View user's profile Send private message
devil1998
PostPosted: Thu Nov 10, 2005 5:34 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Yes maybe,
but if the year before the validation is already '2005' than it stays '2005' and stylesheet will not change it to '05'.
Do you know what i mean?[/b]
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Nov 10, 2005 5:50 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
stylesheet will not change it to '05'
How do you know? Doesn't that depend on the contents of the stylesheet. From what I remember of XSLT, it is quite possible to change the contents of an element when generating the output.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Nov 10, 2005 6:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi - I think we've worked it out. Sorry for being a bit slow.
When you set a breakpoint before the XML Transformation node, you are looking at the message tree which contains the logical value of the date. When the message tree is serialized, the MRM will automatically serialize it according to the 'DateTime Format' setting ( the one you just changed!). It will therefore be serialized as a two-digit date.
In other words, this is nothing to do with the XML Transformation Node - the date will be serialized as '05' before the XML Tranformation Node sees it.
Back to top
View user's profile Send private message
devil1998
PostPosted: Thu Nov 10, 2005 6:36 am    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Why should the stylesheet delete the two first characters, if the input year is '05' and why not if the input year is '2005'?

The line about the date in stylesheet looks so:
<xsl:value-of select="substring(concat(translate(substring(../../despatchInformation/estimatedDelivery/actualShipDateTime,1,19),'-T:',''),$spaces12),1,12)" />
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Nov 10, 2005 8:23 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I suggest you re-read my last post...
Quote:
In other words, this is nothing to do with the XML Transformation Node - the date will be serialized as '05' before the XML Tranformation Node sees it.

...it is the MRM which is writing the year as '05', not the XML Transformation Node.
Back to top
View user's profile Send private message
devil1998
PostPosted: Thu Nov 10, 2005 11:41 pm    Post subject: Reply with quote

Novice

Joined: 07 Apr 2005
Posts: 17

Hi kimbert,

sorry I didn't read the last statement before my...
MMh that means I can not change it? And I have to live with the '05' in the in the output or I do not allow the year '05' in the input only the year '2005'?

thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Nov 11, 2005 4:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Ideally, you should decide on a dateTime format for your input messages, and enforce it. But if you cannot do that...

1. Change the DateTime Format field on creationDateTime back to the 4-digit template.
2. Write some ESQL which catches dates starting in '00' and adds 2000 years to them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Datetime Validation
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.