6 Replies Latest reply: Sep 21, 2010 10:48 AM by 787153 RSS

    formatting date in bpel ,any thoughts?

    787153
      Both Input,Output fields are of type Date.
      Input Date is Julian Date

      I will get Input date as YYYY/MM/DD. I want to format and send- output date as YYYY-MM-DD

      I tried below ways, its not working

      <client:OutputDate>
      <xsl:value-of select="translate(/client:process/client:Order/client:Order/client:InputDate,'/','-')"/>
      </client:OutputDate>


      <client:OutputDate>
      <xsl:value-of select='xpath20:format-dateTime(client:process/client:Order/client:Order/client:InputDate,"[Y0001]-[M01]-[D01]")'/>
      </client:OutputDate>

      Thanks

      Edited by: user13374451 on Sep 17, 2010 4:17 AM

      Edited by: user13374451 on Sep 17, 2010 9:11 AM

      Edited by: user13374451 on Sep 20, 2010 8:39 PM
        • 1. Re: formatting date in bpel
          445096
          I use almost the same conversion and it works fine to me.
          Try usining xp instead of xpath:

          not:
          <xsl:value-of select='xpath20:format-dateTime(client:process/client:Order/client:Order/client:InputDate,"[Y0001]-[M01]-[D01]")'/>

          but use:
          <xsl:value-of select='xp20:format-dateTime(client:process/client:Order/client:Order/client:InputDate,"[Y0001]-[M01]-[D01]")'/>

          greetz, Harrie
          • 2. Re: formatting date in bpel
            787153
            Thanks Harrie,
            Its still not working, For this xsl code, both Input,Output should be type:date in xsd , right?
            InputDate- is JulianDate

            <client:OutputDate>
            <xsl:value-of select='xp20:format-dateTime(client:process/client:Order/client:Order/client:InputDate,"[Y0001]-[M01]-[D01]")'/>
            <client:OutputDate>

            I get an Exception
            javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected EOF in prolog
            at [row,col {unknown-source}]: [1,0]
            Cause: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
            at [row,col {unknown-source}]: [1,0]

            My web service works fine,I don;t understand why I get a SOAP exception. without date field, if I sent xml it works, i get response from external system too.

            Edited by: user13374451 on Sep 16, 2010 6:53 PM

            Edited by: user13374451 on Sep 16, 2010 6:55 PM

            Edited by: user13374451 on Sep 16, 2010 7:08 PM
            • 3. Re: formatting date in bpel
              749381
              Hi !

              Give a try to something like this in transformation:

              <ns2:Date>
              <xsl:value-of select='xp20:format-dateTime(/ns0:update/ns0:body/wo:workorder/wo:workWindow/wo:startsOn,"[Y04]-[M01]-[D01]")'/>
              </ns2:Date>
              • 4. Re: formatting date in bpel
                787153
                Hi KKSingh,

                I get the exception again

                javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected EOF in prolog
                at [row,col {unknown-source}]: [1,0]
                Cause: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
                at [row,col {unknown-source}]: [1,0]
                • 5. Re: formatting date in bpel
                  pavan4s
                  Hi User13374451,

                  This might solve your problem
                  <client:OutputDate>
                  <xsl:value-of select='xpath20:format-dateTime(translate(client:process/client:Order/client:Order/client:InputDate,"/","-"),"[Y0001]-[M01]-[D01]")'/>
                  </client:OutputDate>
                  Seems xpath20:format-dateTime function not accepting date in formats yyyy/mm/dd.


                  Regards
                  PavanKumar.M
                  • 6. Re: formatting date in bpel
                    787153
                    Thanks Pavan,

                    I tried your option, it does not work. I tested by giving YYYY/MM/DD and I get SOAP Exception, if I give YYYY-MM-DD and test it works. But i will get YYYY/MM/DD format from erp system.

                    <xsl:value-of select='xpath20:format-dateTime(translate(client:process/client:Order/client:Order/client:DateRequestedJulian,"/","-"),"[Y0001]-[M01]-[D01]")'/>
                    Error:
                    javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected EOF in prolog
                    at [row,col {unknown-source}]: [1,0]
                    Cause: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
                    at [row,col {unknown-source}]: [1,0]


                    <xsl:value-of select='xp20:format-dateTime(translate(client:process/client:Order/client:Order/client:DateRequestedJulian,"/","-"),"[Y0001]-[M01]-[D01]")'/>

                    Error:
                    javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected EOF in prolog
                    at [row,col {unknown-source}]: [1,0]
                    Cause: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
                    at [row,col {unknown-source}]: [1,0]

                    everything works fine only when I give date in YYYY/MM/DD, I get SOAP Exception

                    However, if I use xp20 or xpath20 I get Exception. and when I use xpath20 I get ERROR in XSL design mode.
                    I am using SOA 11G

                    user 792775 ,user13374451