Convert xsd:dateTime to UTC

Hello community,
Within a message mapping I have to convert a field containing date, time and timezone to UTC/GMT timezone.
Example:
2008-10-06T01:11:06+02:00 = Incoming value from source field, incl. local time + time zone offset
2008-10-05T23:11:06 = Expected value of target field, incl. UTC date and time
How can I achieve this conversion with an UDF?
Best regards,
Wolfgang

Hi,
U can chabge the time zone of the calender ussing TimeZone java class .
Try this UDF:
Import : java.text.*;
UDF:
AbstractTrace trace = container.getTrace();
String strDate =a;// "2008-10-06T01:11:06+0200";
          Date date=null;
          SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
          try{          
               String dt = strDate;          
               date = sdfSource.parse(dt);
               trace.addInfo("NOW1:"+date);
               //Time Zone
               Calendar cal1 = new GregorianCalendar(TimeZone.getTimeZone("GMT+05:30"));
               trace.addInfo("Current Timezone="+cal1.getTimeZone().getDisplayName());
               String timeZoneId = "UTC";//Canada/Central";  // EX.
               trace.addInfo("Getting Time in the timezone="+timeZoneId);
               Calendar mbCal = new GregorianCalendar(TimeZone.getTimeZone(timeZoneId));
               mbCal.setTimeInMillis(date.getTime());
               Calendar cal = Calendar.getInstance();
               cal.set(Calendar.YEAR, mbCal.get(Calendar.YEAR));
               cal.set(Calendar.MONTH, mbCal.get(Calendar.MONTH));
               cal.set(Calendar.DAY_OF_MONTH, mbCal.get(Calendar.DAY_OF_MONTH));
               cal.set(Calendar.HOUR_OF_DAY, mbCal.get(Calendar.HOUR_OF_DAY));
               cal.set(Calendar.MINUTE, mbCal.get(Calendar.MINUTE));
               cal.set(Calendar.SECOND, mbCal.get(Calendar.SECOND));
               cal.set(Calendar.MILLISECOND, mbCal.get(Calendar.MILLISECOND));
               Date newdt =  cal.getTime();
               trace.addInfo("Getting Time in the timezone=####"+newdt);
               SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
               strDate = sdfDestination.format(newdt);
               trace.addInfo("NOW3:"+strDate);
          }catch(ParseException pe){
                trace.addInfo("Parse Exception : " + pe);
return strDate;
Regards
Ritu

Similar Messages

  • Mediator - convert XSD datetime to SQL date value

    Fusion 11g, JDev 11.1.1, W server 2008
    Hi there,
    using JDev we've defined a DB adapter (towards an ORACLE schema), which basically serves two operations: INSERT and SELECT. On the DB table we've got a DATE_TIME while on on the other side we've defined a wsdl where the INPUT operation takes as parameter an XSD DATETIME value.
    The values have different structures and so we've started to play with the "Assign Values" function on the Mediator component, unfortunately without any success.
    Right now our expression is the following
    from
    ora:formatDate($in.newEventParam/newEventParam/ns:executionTime,"dd-MMM-yy")
    to
    $out.LogCollection/top:LogCollection/top:Log/top:when
    As first question I would like to ask you if our approach is correct and in that case what's wrong with our expression as we tried to use the same pattern as we use in SQL.
    Second, we performed some tests using the EM console. On test failure it shown a stack trace saying only that there was a problem performing a transformation. That's a bit too less, especially when transformation is done on large amount of values. Is there any way to increase trace level and get further details on which transformation didn't work out?
    Thanks in advance
    Alessandro Ilardo

    Thanks Eric for the link. That helped me to get further details about the issue but unfortunately not enough to locate the cause.
    So here I definitely have an issue with the composite application and perhaps another one on getting a SOAP trace from the Mediator log. Even with the finest log level enabled I couldn't see what the Mediator receives from outside.
    The first problem instead, seams to be a missing SOAP parameter, I assume that's why on the log I see this
    [WEBSERVICE.name: AuditService] [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Transformation failed[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01203:[No Part]No part exist with name "newEventParam" in source message.Possible Fix:Review the transformation definition in mplan.Contact Oracle Support if the error cannot be fixed.
         at oracle.tip.mediator.service.transformation.XSLTransformer.getPartDocument(XSLTransformer.java:221)
    [J2EE_APP.name: soa-infra] [composite_instance_id: 40011] Got an exception: java.lang.NullPointerException[[
    oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01201:[Error in transform operation]Error occurred while transforming payload.Possible Fix:Review the XSL or source payload. Either the XSL defined does not match with the payload or payload is invalid.
    In this routing there are basically 2 things that take place, an XSL mapping and an Assign value expression.
    Everything is goes fine until we perform a test from the EM, there we get the error.
    Unless someone has further tips on this issue I am considering to make a call from SOAPUI and place WS Monitor in the middle to make sure if the mistake is in the application or platform.
    External WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl" xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" targetNamespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/wsdl">
         <wsdl:types>
              <schema xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def" schemaLocation="xsd/AuditParamsDef.xsd"/>
              </schema>
         </wsdl:types>
         <wsdl:message name="addNewRequestMessage">
              <wsdl:part name="newEventParam" type="ns:add"/>
         </wsdl:message>
         <wsdl:message name="searchRequestMessage">
              <wsdl:part name="searchParams" type="ns:search"/>
         </wsdl:message>
         <wsdl:message name="searchResponseMessage">
              <wsdl:part name="returnParam" type="ns:eventObj"/>
         </wsdl:message>
         <wsdl:portType name="AuditPortType">
              <wsdl:operation name="addNewEvent">
                   <wsdl:input message="tns:addNewRequestMessage"/>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <wsdl:input message="tns:searchRequestMessage"/>
                   <wsdl:output message="tns:searchResponseMessage"/>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="AuditBinding" type="tns:AuditPortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="addNewEvent">
                   <soap:operation soapAction="urn:#addNewEvent"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
              </wsdl:operation>
              <wsdl:operation name="searchForEvents">
                   <soap:operation soapAction="urn:#searchForEvents"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <!--
         <wsdl:service name="AuditService">
              <wsdl:port name="AuditPort" binding="tns:AuditBinding" />
         </wsdl:service>
    -->
    </wsdl:definitions>
    XSL
    <?xml version="1.0" encoding="UTF-8" ?>
    <?oracle-xsl-mapper
    <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
    <mapSources>
    <source type="WSDL">
    <schema location="../AuditService.wsdl"/>
    <rootElement name="newEventParam" namespace=""/>
    <rootElementDatatype name="add" namespace="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"/>
    </source>
    </mapSources>
    <mapTargets>
    <target type="WSDL">
    <schema location="../AuditBackEndService.wsdl"/>
    <rootElement name="LogCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"/>
    </target>
    </mapTargets>
    <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.0.0(build 090618.1440.5219) AT [WED DEC 02 22:51:43 CET 2009]. -->
    ?>
    <xsl:stylesheet version="1.0"
    xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AuditBackEndService"
    xmlns:xpath20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/SOA-POC/AuditService/AuditBackEndService%2F"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ns="http://xml.virtual-lab.eu/schema/poc-soa/audit/def"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    exclude-result-prefixes="xsi xsl ns xsd top tns plt wsdl xpath20 bpws mhdr oraext dvm hwf med ids xdk xref ora socket">
    <xsl:template match="/">
    <top:LogCollection>
    <top:Log>
    <top:who>
    <xsl:value-of select="/newEventParam/ns:fromUser"/>
    </top:who>
    <top:when/>
    <top:whichClient>
    <xsl:value-of select="/newEventParam/ns:usingClient"/>
    </top:whichClient>
    <top:whichSys>
    <xsl:value-of select="/newEventParam/ns:onSys/@ns:which"/>
    </top:whichSys>
    <top:ipClient>
    <xsl:value-of select="/newEventParam/ns:fromIP"/>
    </top:ipClient>
    <top:wsOperation>
    <xsl:value-of select="/newEventParam/ns:callingWS_Operation"/>
    </top:wsOperation>
    </top:Log>
    </top:LogCollection>
    </xsl:template>
    </xsl:stylesheet>
    Internal WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>AuditBackEndService-OR</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:object-relational-class-mapping-descriptor">
    <opm:class>AuditBackEndService.Log</opm:class>
    <opm:alias>LOG</opm:alias>
    <opm:primary-key>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy">
    <opm:queries>
    <opm:query name="AuditBackEndServiceSelect" xsi:type="toplink:read-all-query">
    <opm:criteria operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="and" xsi:type="toplink:logic-expression">
    <toplink:left operator="equal" xsi:type="toplink:relation-expression">
    <toplink:left name="whichSys" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="sys" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="greaterThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="fromWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </toplink:left>
    <toplink:right operator="lessThanEqual" xsi:type="toplink:relation-expression">
    <toplink:left name="when" xsi:type="toplink:query-key-expression">
    <toplink:base xsi:type="toplink:base-expression"/>
    </toplink:left>
    <toplink:right xsi:type="toplink:parameter-expression">
    <toplink:parameter name="toWhen" xsi:type="opm:column"/>
    </toplink:right>
    </toplink:right>
    </opm:criteria>
    <opm:arguments>
    <opm:argument name="sys">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="fromWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    <opm:argument name="toWhen">
    <opm:type>java.lang.String</opm:type>
    </opm:argument>
    </opm:arguments>
    <toplink:reference-class>AuditBackEndService.Log</toplink:reference-class>
    <toplink:container xsi:type="toplink:list-container-policy">
    <toplink:collection-type>java.util.Vector</toplink:collection-type>
    </toplink:container>
    </opm:query>
    </opm:queries>
    </opm:querying>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="LOG" name="ID" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.math.BigDecimal</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>who</opm:attribute-name>
    <opm:field table="LOG" name="WHO" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>when</opm:attribute-name>
    <opm:field table="LOG" name="WHEN" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.sql.Timestamp</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichClient</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>whichSys</opm:attribute-name>
    <opm:field table="LOG" name="WHICH_SYS" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>ipClient</opm:attribute-name>
    <opm:field table="LOG" name="IP_CLIENT" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>wsOperation</opm:attribute-name>
    <opm:field table="LOG" name="WS_OPERATION" xsi:type="opm:column"/>
    <toplink:attribute-classification>java.lang.String</toplink:attribute-classification>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    <toplink:always-refresh>true</toplink:always-refresh>
    </toplink:caching>
    <toplink:remote-caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    </toplink:remote-caching>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:tables>
    <toplink:table name="LOG"/>
    </toplink:tables>
    <toplink:structure>structureName</toplink:structure>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle9Platform</toplink:platform-class>
    <toplink:user-name></toplink:user-name>
    <toplink:connection-url>null</toplink:connection-url>
    </toplink:login>
    </toplink:object-persistence>

  • SPROXY xsd:datetime, UTC and CET dates

    Hello Experts,
    i have a datatype with a field of xsd:datetime type. When i generate the proxy the technical type is defined as XSDDATETIME_Z and the system converts automatically date and time to UTC. I would like it not to happen and i think i should use the domain XSDDATETIME_LOCAL instead. But i don't know how to make sproxy to generate the field with this technical type. And i can't select it from the drop down list available in the field definition of sproxy. Any clue on this?
    Thank you in advance.

    Put a breakpoint in program
    SAPLSPRX_UI
    FORM get_extintview
    on statement:
    IF lv_act_Tab = sesi_tab_extview
    ( = line 76 of include LSPRX_UIF12 in our system).
    Now, in SPROXY, select the field wich should be  XSDDATETIME_LOCAL.
    Debugger pops up.
    in  table
    GT_DYN_FIELD_ATTR  take record with NAME = GS_EXTINTVIEW-OBJECT-ATTR_DT-R3_DATATYP_T
    (the one with having LISTBOX_VALUES entries)
    and add line to the LISTBOX_VALUES with entry
    XSDDATETIME_LOCAL
    XSDDATETIME_LOCAL
    now you can select it in the proxy
    select it and activate it.
    Now you have correct datatype.

  • Xsd datetime format

    Hi, I'm using a javascript popup calendar on a web page which can return a timestamp in either of 3 formats (i can choose whichever):
    dd-mm-yyyy hh:mm:ss
    mm/dd/yyyy hh:mm:ss
    yyyy-mm-dd hh:mm:ss
    I want to convert this form value into the xsd datetime format yyyy-MM-ddThh:mm:ss.
    How can I do this?
    I have been using the following code, but this just deals with today's date. I need to alter it so that it can deal with the value from the popup calendar:
    Calendar calendar = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");
    StringBuffer sb = new StringBuffer( sdf.format(calendar.getTime()) );

    There is no piece ion your code which would set any value.
    Check the API for Calendar, it has many useful methods.

  • ADF Mobile - Secured WS - MarshalException: xsd:dateTime

    Hello,
    Does anybody have an idea how to investigate/resolve following issue with ADF mobile (JDeveloper 11.1.2.3.0):
    Scenario:
    =====
    1. Feature is secured with Credential Authentication : remote
    2. Feature consumes secured Web Service running on WLS 10.3.5.0
    3. oracle/wss_username_token_over_ssl_client_policy is defined for this WS
    4. WSDL file contains <sp:IncludeTimestamp/> in its Transport Binding's Policy
    5. Application was tested on Android emulator (Android 4.1.2) and on Andorid device (Android 2.3.6) with the same behavior.
    Problem:
    =====
    After successful authentication, WLS responses with Error 500 to SOAP request:
    01-21 12:01:34.117: D/CVM(31062): [SEVERE - oracle.adfmf.framework - HttpServiceConnection - log] Connection Error: 500
    01-21 12:01:34.132: D/CVM(31062): [SEVERE - oracle.adfmf.framework - HttpTransport - parseResponse] Response [Error: 500]: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><faultcode>wsse:InvalidSecurity</faultcode><faultstring>weblogic.xml.dom.marshal.MarshalException: xsd:dateTime element does not have required UTC time zone.</faultstring></env:Fault></env:Body></env:Envelope>
    01-21 12:01:34.140: D/CVM(31062): [SEVERE - oracle.adfmf.framework - SoapTransportLayer - invokeSoapRequest] Encountered exception while invoking SOAP request
    01-21 12:01:34.140: D/CVM(31062): EndPoint: https://172.22.30.12:8114/DV900/AddressBookManager
    01-21 12:01:34.140: D/CVM(31062): SOAPAction: "http://oracle.e1.bssv.JP010000//getAddressBook"
    01-21 12:01:34.140: D/CVM(31062): Exception: HTTP Status Code 500 Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request.
    01-21 12:01:34.187: D/CVM(31062): [SEVERE - oracle.adfmf.framework - GenericInvokeRequestHandler - invoke] InvocationTargetException Error: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - HTTP Status Code 500 Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request.
    01-21 12:01:34.195: D/CVM(31062): [SEVERE - oracle.adfmf.framework - GenericInvokeRequestHandler - process] Process AdfException caught: ERROR [oracle.adfmf.framework.exception.AdfInvocationRuntimeException] - HTTP Status Code 500 Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request.
    I assume, that application doesn't send UTC time zone in elements Created:dateTime and Expires:dateTime in Username Token.
    Is there anything what I can set up on JDeveloper side?
    Thanks a lot,
    Daniel

    Daniel,
    I encountered the same issue, webservice when invoked from ADF web app is working fine but, errors in emulator with the below error.
    HTTP Status Code 500 Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request.
    have you got any update from oracle on this ?
    Please do share any work around for this if you have..
    Thanks
    Shreedhar

  • How to deal with xsd:dateTime from webservice in ADF? (Frank can you help?)

    I have a webservice that returns a date in the yyyy-MM-dd'T'HH:mm:ss.SSSZ format (as far as i know the default Calendar type format) specified by an xsd:dateTime. When i generate a webservice datacontrol on the service i get an entry like <Attribute Name="testDate" IsUpdateable="0" Type="java.util.Date" /> in the datacontrol xml file generated for the service (should that not be a java.util.Calendar type?). When i try to output the value on a jsf page it results in the following error:
    oracle.jbo.domain.DataCreationException: JBO-25009: Can not create object of type java.util.Date with value 1994-02-01T00:00:00.000+01:00
    As far as i understand adf tries to create a java.util.Date object from the webservice output 'string' which fails. The webservice is a plsql webservice generated with jdeveloper. If i change the type in the datacontrol xml file from java.util.Date to java.lang.String it prints out the entire date string but i would like to keep it a date type to be able to format the output to the dd-MM-yyyy pattern.
    Any help or suggestions.....?
    Kind Regards,
    Andre Jochems
    Repost
    Repost

    Andre,
    sorry, for not replying earlier - missed this post obviously. I don't know whether or not the behavior you see is correct or a bug - need to investigate this first (or find somebody to invest).
    However, as a work around for now you can:
    Option 1: bind the UI component to a managed bean that then accesses the binding layer to access the Web Service Data Control. This way you can work with Strings and just create a java.util.Date object for the component using the SimpleDate formatter
    Option 2: Use a Web Service proxy and a JavaBean DataControl to access the proxy. This allows pre-processing of the Web Service response, e.g. handling the Date
    Note that this is just for possible work around until I find the time to look at this. However, if this is a blocking issue for a production application then I suggest to contact customer support for immediate help
    Frank

  • How to map field with xsd:dateTime dataType?

    Dear friends,
    I need to produce the following output for a field defined as xsd:dateTime.
    2009-02-18T09:53:02.491+01:00
    I tried with a XSLT mapping with a XPATH function "current-dateTime()". However, the XSLT engine of XI doesn't seem to support this XPATH function.
    How can I produce the output according to the XSD datTime datatype?
    Regards,
    Roberto

    Hi
    You can use XSLT runtime constants.
    http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    Check this link for XSLT date time
    Error in Current Date in XSLT Mapping
    Regards
    Vishnu

  • How to convert .xsd file into corresponding .xml file?

    Hi,
    If any one of you know this, please let me know?
    Thanks,
    Veera

    You cannot convert XSD into an XML as it is already a XMl file, but it defines the rules and restrictions for other XML which abide them.

  • Save xsd:dateTime in java.util.Date

    Hi,
    can anybody give me a code snippet to save a String representing an xsd:dateTime (probably containing timezone information) to java.util.Date?
    I really don't know how to do it.
    Thanks,
    Sven

    In general if you have a String that contains a formatted date, and you want to make a Date object out of that, then you use a java.text.SimpleDateFormat object and its parse() method.

  • Correlation Editor and xsd:dateTime

    Hello,
    is it possible to use a correlations with the type xsd:dateTime?
    I only can choose xsd:date or xsd:time in the correlation editor of the Integration Builder.
    kind regards
    Thorsten Gawantka

    Hi,
    >is it possible to use a correlations with the type xsd:dateTime?
    No as constant you could only choose xsd:date or xsd:time:
    http://help.sap.com/saphelp_nw04/helpdata/en/fe/26da4105aa3f5de10000000a1550b0/frameset.htm
    Regards
    Patrick

  • Xsd:dateTime formatting problems

    This is driving me nuts. I've been playing around with JAXB and it has worked great so far. Until now.
    I have an xml file with this little block
       <timestamps>
          <created>2000-03-04T20:00:00Z</created>
          <last_modified>2003-03-14T02:20:02-05:00</last_modified>
       </timestamps>and in my xsd file I have
        <xsd:element name="timestamps" type="timestampsType" />
      <xsd:complexType name="timestampsType">
        <xsd:sequence>
          <xsd:element name="created" type="xsd:dateTime" />
          <xsd:element name="last_modified" type="xsd:dateTime" />
        </xsd:sequence>
      </xsd:complexType>Previously I had used just xsd:date instead of xsd:dateTime, and that worked fine, but then I realized that I needed more timing precision so I made the change. I can generate my java files with xjc without any problems. But when I go to unmarshall the xml file with validation on, I always get a complaint about the formatting of my date time values. More specificaly I see:
    "com.sun.msv.verifier.ValidityViolation: "2000-03-04T20:00:00Z" does not satisfy the "date" type"
    despite the fact that I copied this date directly from the XSD specification page at http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
    And believe me, I've tried about a dozen other variations.... Different dates, with extra milliseconds, with and without the timezone part at the end. I get the same error every time. So what am I doing wrong?

    Thanks, but unfortunately that did not do the trick. Interestingly enough everything works perfectly, all other things the same, when I let Validation be set to false.

  • Convert SSIS DateTime to a String

    Being a newbie to SSIS I'm not sure of the most efficient method of converting a DateTime object to a String.
    I'm from a C# background where this would be easy using DateTime.ToString("YYYYMMdd"). I want to use the date in a file name so don't require most of the parts.
    I'm sure I could do this using a script task to produce a file name for each row of data in my table and add that filename to the dataset but it seem like overkill to do something that should be simple. Also as I'm supposed to be getting to grips with SSIS I shouldn't keep running back to what I know.
    My current approach is to derive a column and build up an expression to convert the date into a string. The only problem being that it doesn't work.
    The expression I'm working with is:
    (DT_WSTR, 50)([OrgName] ) + "_" + (DT_WSTR, 50)( [PayrollName] ) + (DT_WSTR, 4)(YEAR( [ProcessedDate] )) + (DT_WSTR, 2)(MONTH( [ProcessedDate] )) + (DT_WSTR, 2)(DAY( [ProcessedDate] )) ".txt"
    Can anyone see where I'm going wrong?
    All comments greatly received.
    Cheers
    Ben

    Doesn't work ? What is the error you are getting ?
    Use dt_str instead. Here is an example I am using successfully...
    Code Snippet
    "FileName_" + (DT_STR,4,1252) DatePart("yyyy",getdate()) +
    Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
    Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +Right("0" + (DT_STR,4,1252) DatePart("n",getdate()),2) +".txt"

  • How to convert from Datetime to number?

    chg_date_time
    40265.492
    SELECT c.chg_date_time, TO_DATE('01011900','DDMMYYYY')+CHG_DATE_TIME FROM CHNGHIST C
    After execute:
    30/03/2010 11:48:29
    In the above query, we convert number to datetime.
    Now I want to convert from Datetime to number.
    i.e., 30/03/2010 11:48:29 = ? (40265.492)
    Thanks
    Nihar

    Hello,
    This would do it :SQL> select to_date('30/03/2010 11:48:29','dd/mm/yyyy hh24:mi:ss') - TO_DATE('01011900','DDMMYYYY') nmbr from dual;
          NMBR
    40265,492
    1 row selected.

  • How to convert a datetime value to UTC (or GMT)

    I have this problem.
    The user should provide the following inputs:
    - A date time value - i.e: 10 september 2006, 10:40 AM
    - The world location to which that value refers - i.e.: Rome/Italy
    I need as output, the UTC date time value:
    - i.e: 10 september 2006, 8:40 AM
    in this case it is two hours before because during summer time, the Italian timezone is GMT+2
    And if the user enters:
    - A date time value - i.e: 25 december 2006, 10:40 AM
    - The world location to which that value refers - i.e.: Rome/Italy
    The output should be: (UTC time)
    - i.e: 25 december 2006, 9:40 AM
    It only only one hour before because during winter, in italy the timezone is GMT+1
    In few words I need that Java can do by itself all the calculations about the timezone and daylight saving around different places in the world, so that I can store in my DB the universal UTC time.
    Can you suggest me some code or some good URLs?
    Thanks in advance

    I wrote this code, it works but I have still some issues.
              GregorianCalendar abroad = new GregorianCalendar(TimeZone.getTimeZone("Asia/Tokyo"));
              abroad.set(Calendar.YEAR, 2006);
              abroad.set(Calendar.MONTH, 11);
              abroad.set(Calendar.DATE, 25);
              abroad.set(Calendar.HOUR_OF_DAY, 1);
              abroad.set(Calendar.MINUTE, 0);
              abroad.set(Calendar.SECOND, 0);
              System.out.println(abroad.getTime());
            DateFormat df1 = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
              df1.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));
              System.out.println(df1.format(abroad.getTime()));
            DateFormat df2 = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
              df2.setTimeZone(TimeZone.getTimeZone("America/New_York"));
              System.out.println(df2.format(abroad.getTime()));
            DateFormat df3 = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
              df3.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
              System.out.println(df3.format(abroad.getTime()));          It outputs:
    Sun Dec 24 17:00:00 CET 2006
    luned� 25 dicembre 2006 1.00.00 JST
    domenica 24 dicembre 2006 11.00.00 EST
    domenica 24 dicembre 2006 16.00.00 UTCIn few words this code is able to compute any date from a specific timezone, to other timezone.
    My questions are:
    - Why the first output is in english ? and the other are in italian? (my OS is italian) but I didn't changed the locale in the code, so I don't understand why it outputs english text.
    - When I get the date value in other timezones, I just get a "string" computed by the "format(...)" method of the DateFormat class.
    But I really need to get something "numeric" for every specific value: minutes, hours, day of the month, month, year. Because this class will be used outside java and I don't need a string but something that the user will have formatted in his choosen locale setting for its website. (i think that I was not good to explain this point, i hope that someone can understand)
    However thank you all :)

  • Convert String to java UTC date then to sql date

    Hi,
    I am trying to convert string (MM/dd/yyyy format) to UTC date time and store in the database.
    This is what I did:
    String dateAsString = "10/01/2007";
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
    formatter.setLenient(false);
    java.util.date dateValue = formatter.parse(dateAsString, new ParsePosition(0));
    dateValue will be Sun Sep 30 20:00:00 EDT 2007 in UTC.
    Now I need to store this date and time to MS SQL database.
    I used the following code:
    java.sql.Date sqlDateValue = new java.sql.Date(parsedToDate.getTime());
    But this code give only the date, not time 2007-09-30
    Can anybody tell me how I can change this java date to sql date (or datetime?) so that I can get both date and time.
    Thanks,
    semaj

    semaj07 wrote:
    Hi,
    I am trying to convert string (MM/dd/yyyy format) to UTC date time and store in the database.
    This is what I did:
    String dateAsString = "10/01/2007";
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
    formatter.setLenient(false);
    java.util.date dateValue = formatter.parse(dateAsString, new ParsePosition(0));
    dateValue will be Sun Sep 30 20:00:00 EDT 2007 in UTC.
    Now I need to store this date and time to MS SQL database.
    I used the following code:
    java.sql.Date sqlDateValue = new java.sql.Date(parsedToDate.getTime());
    But this code give only the date, not time 2007-09-30
    Can anybody tell me how I can change this java date to sql date (or datetime?) so that I can get both date and time.
    Thanks,
    semajTake a look at java.sql.Timestamp:
    http://java.sun.com/javase/6/docs/api/java/sql/Timestamp.html
    Edited by: hungyee98 on Oct 17, 2007 8:57 AM

Maybe you are looking for

  • I can't convert my 3.x start routine to BI 7.0 start routine...

    Hi All, Can anyone help me to convert the below coding from 3.x start routine to BI 7.0 start routine. PROGRAM UPDATE_ROUTINE. $$ begin of global - insert your declaration only below this line  - TABLES: ... DATA:   ... $$ end of global - insert your

  • Park and Post for Down Payment Request (F-47)

    SAP Gurus, We are having requirement for park and post in Down Payment Request (F-47). So that it is approved by an authoriser. Hence, Is it possible to workflow a down payment request to an authoriser for approval Please share with me options availa

  • How do I stop IN CLAUSE when query a hierarchy of object.

    I have a base class which is annotated with @Entity(name="UdmHierarchyObject") @Table(name="UDM_HIERARCHIES") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class UdmHierarchyObject ... I have a single table hierarchy of objects which u

  • Automatic Credit check.

    Dear Gurus, While running the Automatic Credit we have the Options like we can control the customers at Order level,Delivery level and Goods Issue Level. Suppose if we want control at delivery level,How system checks the Value of the delivery while c

  • Time-based publishing stopped working

    Hi, We currently have a problem with time-based publishing in KM. Since a few days ago, documents stopped becoming visible once they reach their "valid from" date. We have not been able to publish documents with TBP since then on that system. These e