Author |
Message
|
asalema |
Posted: Fri Sep 22, 2006 3:46 pm Post subject: Why does MessageSet transform datetime format?! |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
Hi All,
I have a flow as follows
HTTPInputNode ->XMLtransformation->HTTPReply
I use a messageset on the HTTP input node in which I set the Validation to "content" and parsing timing to "Immidiate"
In the message definition file I have a BirthDateTime field of time xsi:datetime
When I send a valid request through the HTTPInput like this
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wsReqToHL7_GetPersonDemographics.xsl"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://ephsprj.org/GetPersonDemographicsBO" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<bo:GetPersonDemographicsReqWS
xmlns:bo="http://ephsprj.org/GetPersonDemographicsBO"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ephsprj.org/GetPersonDemographicsBO EPHS_GetPersonDemographics_WSBO.xsd">
<QueryParameter>
<ClientID>
<root>1234</root>
<extension>ABC</extension>
</ClientID>
<ClientID>
<root>2234</root>
</ClientID>
<ClientID>
<root>3234</root>
<extension></extension>
</ClientID>
<ClientID>
<root>45</root>
<extension>CDE</extension>
</ClientID>
<PersonName>
<given>Bruce</given>
<given>J</given>
<family>Jackson</family>
<prefix>Dr.</prefix>
</PersonName>
<Address>
<unitType>unit type</unitType>
<!-- <delimiter>del</delimiter> -->
<country>Canada</country>
<state>BC</state>
<!-- <county>orange</county> -->
<city>Vancouver</city>
<postalCode>V1V 1V1</postalCode>
<streetAddressLine>street address line 1</streetAddressLine>
<streetAddressLine>street address line 2</streetAddressLine>
<direction>N</direction>
<streetName>street name</streetName>
<streetNameBase>street name base</streetNameBase>
<streetNameType>street name type</streetNameType>
<additionalLocator>add.locator</additionalLocator>
<unitID>unit id</unitID>
<carrier>car</carrier>
<censusTract>ct</censusTract>
</Address>
<Address>
<city>Burnaby</city>
<streetName>Canada Way</streetName>
</Address>
<!-- <BirthDate>1999-12-31</BirthDate> -->
<BirthDateTime>2013-05-26T23:10:35Z</BirthDateTime>
</QueryParameter>
</bo:GetPersonDemographicsReqWS>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
it passes validation and I get an MRM message at the HTTPInput node's out terminal. However, the BirthDateTime format get transformed to
Code: |
2013-05-26 23:10:35.000
|
which is different from the input format. My question is why does MRM MessageSet transforms the datetime format? This is causing problems during message transformation.
I appreciate any help with this.
Regards, |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 22, 2006 4:37 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think your input date time didn't have a timezone.
So when you cast it as a date, and processed it, it assumed that the value was in localtime, rather than GMT time, and so got it wrong. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Sep 23, 2006 12:41 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Jeff may be correct, but we still need to account for the 'T' changing to a space between input and output.
- How did you create the message definitions ( probably by importing an xsd file )
- What dateTime template is displayed for BirthDate in its XML properties?
- Please describe the XML Schema structure in which BirthDate is defined ( details of the parent complex type should be enough scope ). |
|
Back to top |
|
 |
asalema |
Posted: Sat Sep 23, 2006 6:05 pm Post subject: |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
Hi
Thx a lot jefflowery and kimbert for jumping to help me out. You both have good points.
I did try jefflowery's recommendation for specifying time zone. So, I set the time zone explicitly in message set in the physical properties of the XML1. Unfortunately, this didn't work.
Kimbert's point looks good too although I looked at the XSD I used to import the Message definition file and it sounds very straightforward. Here is an excerpt from the XSD related to the birthdatetime field
Code: |
<schema targetNamespace="http://ephsprj.org/GetPersonDemographicsBO"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:bo="http://ephsprj.org/GetPersonDemographicsBO"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
.............................
............................
<complexType name="QueryBYParameterLoad">
<sequence>
<element name="ClientID" type="bo:Client_id" minOccurs="0"
maxOccurs="unbounded">
</element>
<element name="PersonName" type="bo:Person_name"
minOccurs="1" maxOccurs="1">
</element>
<element name="Address" type="bo:Person_address"
minOccurs="0" maxOccurs="unbounded">
</element>
<choice minOccurs="0" maxOccurs="1">
<element name="BirthDate" type="bo:Person_birthDate"></element>
<element name="BirthDateTime"
type="bo:Person_birthDateTime">
</element>
</choice>
</sequence>
</complexType>
..............................
..............................
<simpleType name="Person_birthDateTime">
<restriction base="dateTime"></restriction>
</simpleType>
.......................................
.......................................
</schema>
|
Could it be related to using a choice to define the Birthdatetime?
I will perform some testing to take out the choice definition in the "QueryBYParameterLoad" parent and see if that makes any difference. I would really appreciate any other recommendations that I can test.
Thx again for your help
Regards, |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 23, 2006 10:45 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Look on the message set. There is a field in the XML format properties that takes a template for strict date and time checks and timestamp formatting.
You need to set the right format there and when serializing a broker GMTTIMESTAMP or TIMESTAMP format it will be serialized according to those preferences. You can also use esql with CAST AS STRING FORMAT...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Sep 25, 2006 2:24 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I would really appreciate any other recommendations that I can test. |
1. Put a trace node in the message flow just before the MQOutput node. Set its pattern to '${Root}. Post the relevant part of the message tree here.
2. What dateTime template is displayed for BirthDate in its XML properties? It's well worth taking a look, because if the specified template is not being used, then something strange is going on. If something strange is going on, the trace node output might reveal it.
3. You asked 'Could it be related to using a choice to define the Birthdatetime? '. I don't think so - XML choices rarely cause the MRM parser any problems. |
|
Back to top |
|
 |
msukup |
Posted: Tue Nov 14, 2006 8:01 pm Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
i am sticking this post on the end of this post, since my question is somewhat related. here is my problem:
environment: WMB 5.0, CSD 5
i have imported xml schema into MRM; several fields are defined as xsd:dateTime; no modifications to mrm message set after import. I then generate an xml file based on schema (also through toolkit), put to flow that is parsing against the message set.
Here is one such element in the schema:
<xsd:element maxOccurs="1" minOccurs="1" name="LastUpdateTS"
nillable="false" type="xsd:dateTime"/>
The input field value looks like 2001-12-31T12:00:00
the local element properties of date field show the physical representation of the dateTime format as yyyy-mm-dd'T'hh:mm:ssZZZ
However, when mrm tries to parse message, it fails with the following exception:
(0x03000000):File = '/build/S500_P/src/MTI/MTIforBroker/MtiI
bParser2/MtiImbParser.cpp'
(0x03000000):Line = 548
(0x03000000):Function = 'MtiImbParser::parseRightSibling'
(0x03000000):Type = 'ComIbmMQInputNode'
(0x03000000):Name = 'Erisa#FCMComposite_1_1'
(0x03000000):Label = 'Erisa.MER.EA.ERISA.REQUEST'
(0x03000000):Text = 'ImbRecoverableException caught from wor
er->parseNext.'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5285
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'Erisa'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'XML1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'Erisa'
)
(0x01000000):ParserException = (
(0x03000000):File = '/build/S500_P/src/cpi/pwf/xml/xmlhand
er.cpp'
(0x03000000):Line = 1274
(0x03000000):Function = 'XMLHandler::convertStringToData'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'Error converting characters into a da
a value'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5404
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '1217'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'Erisa'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'CreateTS'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'DateTime'
)
(0x01000000):ParserException = (
(0x03000000):File = '/build/S500_P/export/rios_aix_4/usr/include
/pwficudatetime.h'
(0x03000000):Line = 184
(0x03000000):Function = 'PWFICUDateTime::Parse'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Text = 'CPI Unable to parse datetime internally'
(0x03000000):Catalog = 'BIPv500'
(0x03000000):Severity = 3
(0x03000000):Number = 5540
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '9'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '2001-12-31T12:00:00'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'yyyy-MM-dd'T'HH:mm:ssZZZ'
)
)
My ideal would be that the xml schema drives everything and no changes need to be made to the message set. i know you might reccommend applying a CSD -- can't do it in the timeframe. but i would love to know if what appears to be a bug to me is in fact fixed in later versions. Or, if there is a workaround/interim fix, that would also be lovely. (yes, can go pmr route, but that process is so tedious)
thanks in advance |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 15, 2006 3:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's no "live" connection between the schema and the message definition files.
If you change the schema, you'll have to recreate the message definition file by re-importing the schema. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 15, 2006 3:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Does the problem go away if you remove the 'ZZZ' from the end of the template? |
|
Back to top |
|
 |
msukup |
Posted: Wed Nov 15, 2006 3:44 am Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
that wasn't really my question -- i know there is no "live" connection, but i want to minimize changes to message set and rely solely on import. (who is going to remember all the little things you have to change to make it validate against the schema)
it's probably a moot point -- the readme of the CSD 8 states that MRM parsing of dateTime is fixed. in my dreams (pathetic that this was in my dream), i thought of a workaround -- involves a lot of ugly code, and i would have preferred to rely on the mrm solely, but c'est la vie. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 15, 2006 6:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to uncheck "strict date time checking" on the message set. This will allow some stuff that would get rejected to parse where date time is concerned.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
msukup |
Posted: Fri Nov 17, 2006 7:18 pm Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
thank you, i will try that out! i'll also try out removing ZZZ. |
|
Back to top |
|
 |
|