App Connect

 View Only
  • 1.  XMLNSC parser for datetime in GMT format

    Posted Tue November 22, 2022 01:05 AM
    We have a production issue that incoming message has a field value as GMT date format, but AppConnect xmlnsc parser doesn't take the timezone, always treat as local time. 

    ex.: the incoming message has a field:
    <gmtDateTime>2022-10-28T11:43:17.215Z</gmtDateTime>

    which defines as 
    <xsd:element name="gmtDateTime" type="xsd:dateTime"/>
    In xsd. 

    when the message is parsed by xmlnsc parser, the value doesn't change to local date/time, still as 2022-10-28T11:43:17.215.  In debugger, I see this: 
    gmtDateTime:TIMESTAMP:java.util.GregorianCalendar[time=1666982597215,areFieldsSet=true,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2022,MONTH=9,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=28,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MINUTE=43,SECOND=17,MILLISECOND=215,ZONE_OFFSET=?,DST_OFFSET=?]

    I have tested using value as 2022-10-28T11:43:17.215 or 2022-10-28T11:43:17.215-08:00,  in the debugger, I see the same result by the xmlnsc parser. 

    In the server.conf.yaml, i have updated as following: 
    ESQL:
    castWithAccurateZoneOffsets: true
    alwaysCastToLocal: true
    XMLNSC:
    invalidCharacterEscapeType: unicode
    storeTimeZoneInValue: true
    writeTimeZone: whenSet

    wonder if you have seen this issue and what I need to do in order to parse the datetime with the timezone to correct local time. 

    Many thanks, 

    andy


    ------------------------------
    Andy Mao
    ------------------------------


  • 2.  RE: XMLNSC parser for datetime in GMT format

    User Group Leader
    Posted Mon December 05, 2022 02:39 PM

    Hello @Andy Mao :)

    it would depend if it is App Connect ACE or IIB - luckily, our team provided the solution to both.

    ACE:
    (server.conf.yaml)
      XMLNSC:
        #storeTimeZoneInValue: true        # Sets XMLNSC parsers to store timezone information as part of the Datetime value that is parsed.
        #writeTimeZone: whenSet            # Sets XMLNSC parsers to write timezone information when an XML document is serialized. Choose one of never|whenSet|nonUTC|nonLocal|always


    For IIB: 

    IIB:
    mqsireportproperties n -e s -o ComIbmGenericXmlParserFactory -aComIbmGenericXmlParserFactory
      uuid='ComIbmGenericXmlParserFactory'
      userTraceLevel='none'
      traceLevel='none'
      userTraceFilter='none'
      traceFilter='none'
      invalidCharacterEscapeType='none'
      storeTimeZoneInValue='yes'
      writeTimeZone='whenSet'
      cdataFieldMerging='no'
      xlxpSymbolTableSizeInKB='1024'

    Let me know if that helps!!



    ------------------------------
    Gabriel Marte Blanco
    Austin TX
    ------------------------------



  • 3.  RE: XMLNSC parser for datetime in GMT format

    Posted Mon December 05, 2022 02:49 PM
    Hi Gabriel,

    Thanks for your reply.  In my post, I have provided the ACE sever.conf.yaml which has the same configuration, which doesn't help.  Actually, we have finally made it work while casting the GMT or local time with no timezone using pattern 'IU', for both String and timestamp data type.  

    Thanks
    andy

    ------------------------------
    Andy Mao
    ------------------------------