Webservice date format

I have used "clientgen" Ant task to generate the client library. The WSDL indicates that certain fields are of type xsd:date.
The web service client sends sends "2009-08-04T13:55:46.237-04:00".
However, the server expects "2009-08-04".
In the WSDL file, after you following all the links/referers URLs, you end up with the type definition:
<xs:simpleType name="PublicationDate">
<xs:restriction base="xs:date"/>
</xs:simpleType>
My questions are:
1. Is the client behaving correctly? The WSDL indicates this field is a "date" and NOT "dateTime". Perhaps the problem is in the "clientgen" Ant task which is not generating the client stubs/implementation correctly?
2. How can I change the manner in which the date gets formatted and passed on the SOAP body (java.util.Calendar)?
Edited by: user8651233 on Aug 5, 2009 7:15 AM

When trying to generate a client for your JAX-RPC web service from a schema. The schema includes
an schema datatype which is derived from a standard schema datatype by restriction. For example
<xs:simpleType name="SampleDate">
<xs:restriction base="xs:date"/>
</xs:simpleType>
When clientgen task is used, there is no custom class created to represent this schematype and the WSDL mappings map to the standard schema datatype rather than to your custom datatype. Subsequently, when the web service request is made, it too generates the request using the standard datatype rather than your custom datatype. The web service is expecting the custom datatype, so the request fails with a SOAP fault
There is a restriction on what Java data types can be automatically generated by the WebLogic ant
tasks: specifically, a schema data type is derived "by restriction of an existing simple type," it
is generated as the "equivalent Java data type of simple type."
This is the expected behavior for the JAX-RPC ant tasks, so the system is functioning as designed.
The solution is to program the appropriate class yourself. To do that, you would set up a class
which handles that element and does what it needs to do with the data in it.Then you would need to change the mappings that are automatically generated to point to your new custom class .
Once all that is in place, recompile your war file and retest. As long as everything is pointing
to the right places, the request and subsequent response should then be correct.
-Chandrasen.
Edited by: user10600598 on Aug 27, 2009 9:08 AM

Similar Messages

  • BAPI - Webservice, Date-Format changed

    Helly everyone,
    I've got a problem when creating a WS based uppon a BAPI (BAPI_FLIGHT_GETDETAIL). The Webservice itself works fine. But if I use the BAPI I need to use the Date-Format DD.MM.YYYY for the required Input-Field Flightdate. In the WS I need to use the format YYYY-MM-DD. Now, is there any way to use the DD.MM.YYYY-Format in the WS also?
    Greetings

    Hi Marcel,
    Thanks for the fast reply. I will give it a try probably.
    I am still wondering what could have changed the date format.
    Originally Posted by Marcel_Cox
    I^d be suprised if it is really SP8 that changed your date format on the server console.
    In any case, the date format on the server console is controlled by the file lconfig.sys copied to the server's c:\nwserver directory at installation time.
    The following TID tells you how you can replace this file.
    Note that the TID refers to changing the code page. In your case, it is not the code page you want to change, but the country code which corresponds to the date format you want to display
    10093487: Convert existing NetWare server to different Codepages.

  • How to know date format of client in webservices

    I have made a webservice which takes Date from the client. But these clients can have there own regional settings like DD/MM/YYYY or MM/DD/YYYY or YYYY/MM/DD.
    It would be helpful if someone can tell me how to know the date format of the client in server for a webservice
    regards,
    Saurabh

    If a service recieves messages with values that are typed in WSDL as wxs:dateTime or a restriction thereof, then the data is fixed in its format to ISO 8601, and has nothing to do with the localisation settings of the client machine.
    The question 'does typing a value as xsd:dateTime in WSDL fix the format' and the question 'how can a server know the regional settings of a client' are not the same question. AFAIK, the majority of public web services do not use WSDL nor WXS.
    Pete

  • Issue with Date format - ABAP to XML

    Dear Users,
    We are currently facing an issue with the date formats in XML.
    We have a system (.Net), which has a webservice that we are calling for information from SAP. We created a Proxy class in SAP from the WSDL file and have attempted to use the method that gets us required information based on the Timestamp passed from SAP. However, the timestamp that the INPUT structure uses has a data element XSDDATETIME_Z.
    All we can send from SAP is a simple TIMESTAMP, but the .Net system doesn't accept it since it wants the timestamp in XML format i.e. <dd-mm-yyyy>T<hh:mm:ss>Z. SAP documentation says that the field should automatically do conversion from ABAP to XML format, but that doesn't happen. We don't want to build a string from Timestamp in the XML format and send it out since we might surely miss out on the different cases involved.
    Can anyone please suggest a way for us to send the date out in the required XML format?
    Many thanks!

    Hi Vijay,
    Look at the below sample code and it works fine, i guess there is something wrong in your code or conversion, post the actual code if you are still not able figure it out with the below example.
    DATA: l_xml_string TYPE string,
          l_dat_time TYPE xsddatetime_z.
    CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'
    EXPORTING
       I_DATE                         = sy-datum
       I_TIME                         = sy-uzeit
    IMPORTING
       E_TIMESTAMP                    = l_dat_time
    EXCEPTIONS
       DATE_NOT_FILLED_BUT_TIME       = 1
       DATE_HAS_NO_VALID_FORMAT       = 2
       OTHERS                         = 3.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL TRANSFORMATION id
      SOURCE root = l_dat_time
      RESULT XML l_xml_string.
    IF sy-subrc EQ 0.
    write: l_xml_string.
    ENDIF.
    Regards,
    Chen

  • Required help with date format

    Hi All,
    I am calling a webservice from plsql, for this I am using UTL_DBWS package. I want to insert the format of date as 'YYYY-MM-DD' only. I used to_char(sysdate, 'YYYY-MM-DD') , but it is throwing error. Please suggest any solution.
    Thanks and Regards,
    Mahesh
    The error details are as follows
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException
    Caught exception while handling request: invalid date: 25-NOV-08
    ORA-06512: at "SYS.UTL_DBWS", line 403
    ORA-06512: at "SYS.UTL_DBWS", line 400

    user6391695 wrote:
    Hi All,
    I am calling a webservice from plsql, for this I am using UTL_DBWS package. I want to insert the format of date as 'YYYY-MM-DD' only. I used to_char(sysdate, 'YYYY-MM-DD') , but it is throwing error. Please suggest any solution.What happens is...
    You convert sysdate into a string of the format YYYY-MM-DD and then you are passing that to a parameter that is a DATE datatype. When you do this oracle has to implicitly conver the string to the DATE datatype. It does this based on the NLS settings of the session which, I would guess, are not of the format YYYY-MM-DD, so it can't understand the string you have passed and fails to convert it to a date.
    Date formats are not something that is stored on the database (assuming you are correctly storing dates as DATE datatype). The format of dates is a display issue and something that should be handled by the user interface. The database stores data, just that, no display formats. ;)

  • How to know date format of client

    I have made a webservice which takes Date from the client. But these clients can have there own regional settings like DD/MM/YYYY or MM/DD/YYYY or YYYY/MM/DD.
    It would be helpful if someone can tell me how to know the date format of the client in server for a webservice
    regards,
    Saurabh

    If a service recieves messages with values that are typed in WSDL as wxs:dateTime or a restriction thereof, then the data is fixed in its format to ISO 8601, and has nothing to do with the localisation settings of the client machine.
    The question 'does typing a value as xsd:dateTime in WSDL fix the format' and the question 'how can a server know the regional settings of a client' are not the same question. AFAIK, the majority of public web services do not use WSDL nor WXS.
    Pete

  • Issues with result data display on ADF page from a Webservice data control

    Hi,
    I created a Webservice Data control and created a JSF to display the webservice response to the screen.
    I dragged and dropped the input paramater to the JSF form.Also i did the same for the output result also.i drag & drop the result tag to the JSF(selected the read only form).
    This webservice is a complex input and output params.
    After supplying the input param to the jsf and clicked on submit, the request is going and hitting the webservice and getting proper result set also.
    But the issue is , the result is not displayed on the JSF screen.
    Is there any configuration needed to diaply the content on ths screen?
    Version - JDev 11.1.1.4.0
    Regards,
    JJ

    Dear Vinod,
    Thanks for the reply.
    How to refresh the data container ..just to press the refresh button(F5) or is there any configuration needed to auto refresh the data container?
    The following is my table definition
    <af:table rows="#{bindings.LookListRow.rangeSize}"
    fetchSize="#{bindings.LookListRow.rangeSize}"
    emptyText="#{bindings.LookListRow.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row"
    value="#{bindings.LookListRow.collectionModel}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.LookListRow.collectionModel.selectedRow}"
    selectionListener="#{bindings.LookListRow.collectionModel.makeCurrent}"
    rowSelection="single"
    binding="#{backingBeanScope.backing_lkUp.t1}"
    id="t1" columnSelection="single">
    <af:column headerText="#{bindings.LookListRow.hints.rowAction.label}"
    sortProperty="rowAction" sortable="false"
    id="c5">
    <af:outputText value="#{row.rowAction}" id="ot4"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.FieldValue.label}"
    sortProperty="FieldValue" sortable="false"
    id="c8">
    <af:outputText value="#{row.FieldValue}" id="ot8"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.FieldName.label}"
    sortProperty="FieldName" sortable="false"
    id="c2">
    <af:outputText value="#{row.FieldName}" id="ot7"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.Description.label}"
    sortProperty="Description" sortable="false"
    id="c1">
    <af:outputText value="#{row.Description}" id="ot2"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.StatusasofEffectiveDate.label}"
    sortProperty="StatusasofEffectiveDate"
    sortable="false" id="c4">
    <af:outputText value="#{row.StatusasofEffectiveDate}"
    id="ot5"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.LanguageCode.label}"
    sortProperty="LanguageCode" sortable="false"
    id="c6">
    <af:outputText value="#{row.LanguageCode}" id="ot6"/>
    </af:column>
    <af:column headerText="#{bindings.LookListRow.hints.Version.label}"
    sortProperty="Version" sortable="false" id="c3">
    <af:outputText value="#{row.Version}" id="ot3">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.LookListRow.hints.Version.format}"/>
    </af:outputText>
    </af:column>
    Regards,
    -JJ
    Edited by: user13117752 on Jun 14, 2011 11:20 PM

  • Problem with Date formatting

    Hi Tim,
    I am facing some issues with formatting the date using XMLP. The following is the sample XML data file i am using:
    <LIST_G_HEADER>
    <G_HEADER>
    <QUOTE_HEADER_ID>1455</QUOTE_HEADER_ID>
    <QUOTE_NUMBER>2027</QUOTE_NUMBER>
    <QUOTE_VERSION>1</QUOTE_VERSION>
    <QUOTE_NAME>Test GM Report - Rabindra</QUOTE_NAME>
    <SOURCE_NAME>Fletcher, MR. Paul</SOURCE_NAME>
    <QUOTE_DATE>27-OCT-2005</QUOTE_DATE>
    <CURRENCY_CODE>GBP</CURRENCY_CODE>
    </G_HEADER>
    </LIST_G_HEADER>
    The formatting i use for my date field i.e <QUOTE_DATE>, ends up either with NO formatting or giving me an error "[010906_114656657][][ERROR] Invalid XSD string: 27-OCT-2005 (XMLP Template Viewer)". The default formatting available with the form field dialog box (MS-Word) feature also doesn't work.
    I have the following formatting for this field in the form field:
    <?format-date:QUOTE_DATE; 'MEDIUM' ?>
    When i read the user guide, it reads that the date should be in the canonical format i.e: YYY-MM-DDThh:mm:ss+HH:MM
    However i am not getting the date from the base table's in this format. Is the error happening due to incorrect format or is there some other reason behind this? Please let me know, how can i overcome this issue.
    Thx,
    Nitin

    As i mentioned in another thread
    substring function and date format
    Please use this standards
    <?xdofx:expression?>
    for extended SQL functions or
    <?xdoxslt:expression?>
    for extended XSL functions.
    Use like
    <?xdofx:rpad(LAST_NAME),30, ’x’)?>
    <?xdofx:Instr(’abcabcabc’,’a’,2))?>
    <?xdofx:upper(char)?>
    <?xdofx:lower (char)?>
    <?xdofx:greatest ( expr [, expr]... )?>
    ETC.....

  • How can we give the Data Format (File Type ) in Runtime

    Hi all,
    How can we give the Data Format (File Type ) in Runtime for the following method,
    cl_gui_frontend_services=>gui_download.
    Thanks in advance
    Sri

    There is a filetype parameter which you can set
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
    *    BIN_FILESIZE              =
        filename                  =
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      changing
        data_tab                  =
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24

  • Need to convert into date format

    Hi all,
    I need to convert '2008-11-26T11:07:38-06:00' [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS][TIMEZONE]
    in format 'YYYY-MM-DD HH:MM:SS'.
    Thanks in advance.

    >
    Thank you for your reply
    But it is giving me output as '26-NOV-08'
    And I want in format '2008-11-26 07:38' i.e 'YYYY-MM-DD HH:MM'.
    >
    Then you are not looking for a date, You are looking for a string.
    The date format that gets displayed is dependent on nls_date_format parameter.
    If you want a string in the format you asked, then,
    SELECT TO_CHAR ( TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"'), 'YYYY-MM-DD HH24:MM:SS')
      FROM DUAL;Or if you just want the date to be displayed like that then
    Do,
    SQL> alter session set nls_date_Format="YYYY-MM-DD HH24:MI:SS";
    Session altered.
    SQL> SELECT TO_DATE ( '2008-11-26T11:07:38-06:00', 'YYYY-MM-DD"T"HH24:MI:SS"-06:00"') dt
      2    FROM DUAL;
    DT
    2008-11-26 11:07:38
    SQL> G.

  • Changing date format at reporting level

    Hello,
    Will u plz tell me how can i change the date format at reporting level?
    I want to display date in dd/mm/yyyy, but by default its showing mm/dd/yyyy.
    Delta is already loaded in the system, so i don't want to disturb regular data loading.
    Is there any way so that i can change the format of date.
    Plz help me out.
    Thanks,
    Regards,
    Steve

    Hi steve
    There r so many postings on the same topic
    go through these previous threads
    date format
    Date format
    u can find solution
    regards
    Ravi Kiran

  • How to convert the numeric to date format

    HI ,
         We have created the date KF and selected the data type as DEC-numeric or counter and add in the cube.
          the data for this fields in the cube are in numerics like  734.504, but when we execute the report it is converted in to date format dd.mm.yyyy.
                    My issue how this conversion is working in the backend while executing the report.
    Regards.
    venkata

    Conversion is happening because of the type you had selected for the KF while creating it.
    Check the type of the Key figure?
    While creating the KF you might have selected the Type as Date and Data type -DEC : Counter or amount field with comma and sign.
    that's the reason why you are getting the output values displayed in dd.mm.yyyy format.
    For amount field - create a KF with type "AMOUNT" and unit -0currency or specify the currency of that region.
    regards
    KP

  • How to get Date Format from Local Object.

    Hi All,
    I am new to Web Channel.
    I need to know Date format From date of locale.
    suppose there is a date "01/25/2010" date in date field I want to get string "mm/dd/yyyy". Actually I have to pass date format to backend when I call RFC. 
    Is there any way to get Date format from "Locale" object. I should get date format for local object
    I get local object from "UserSessionData" object but how to get Date format from it.
    I am not looking for Date value. I am looking for current local date format ("mm/dd/yyyy or dd/mm/yyyy or mon/dd/yyyy) whatever local date format.  I could not find example which show how to get date format from "Locale" object.
    Any help will be appreciated with rewards.
    Regards.
    Web Channel

    Hi,
    You can get it from "User" or "Shop" business object.
    Try to get User or Shop Business Object as shown below.
    BusinessObjectManager bom = (BusinessObjectManager) userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
    User user = bom.getUser();
    char decimalNotation = user.getDecimalPointFormat().getGroupingSeparator();
    If you are seeing "1,234.00" then above code will return "."
    I hope this information help you to resolve your issue.
    eCommerce Developer.

  • How to change default Date format in BO 6.5 SP4

    A problem with date display has been reported to me by one of our users -  in BO 6.5 - since installing SP4.
    The default date format is now MM/DD/YYYY
    I have tried to recreate this on my PC and have been able to confirm that this is the case.
    Most of our PC's will have two versions of Business Objects on them - for 5.1.6 and for 6.5 - that is the case for my PC.
    If I create a new BO document based on a spreadsheet with three entries in the spreadsheet as follows:-
    20/01/2009    20-Jan-2009  20th January 2009
    This displays in BO 6.5 as
    1/20/2009   1/20/2009    20th January 2009
    My PC regional setting is UK and the time displays DD/MM/YYYY
    Can you advise how to correct this problem please.

    Hi Sebastien
    Thank you for your response.
    I haven't checked Dimension in universe because this is happening even when datasource is an Excel spreadheet - as per details in previous post.
    I have looked for *.sbo files and found one for ODBC.sbo in the Version 5 folders on PC - with date format details in it which I've changed - that doesn't make any difference.
    Any other ideas?
    Regards
    Linda

  • Date format issue in oracle database

    Hi,
    Back end : Oracle 11.2.0.2.0
    Front end : Forms 11g
    In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
    Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
    In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
    The Nls_date_format parameter at database level is set as 'DD-MON-RR'
    Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
    pls help us to solve the issue.
    Regards.
    sathish k

    892913 wrote:
    Hi,
    Back end : Oracle 11.2.0.2.0
    Front end : Forms 11g
    In our application we are facing issue with TO_DATE('DD/MM/YYY') Date format conversion.
    Example: TO_DATE(P_date,'DD/MM/YYYY') giving the result as 20-Dec-0009
    In the above eg the Parameter P_date is coming as '20-dec-09' from the front end (forms 11g)
    The Nls_date_format parameter at database level is set as 'DD-MON-RR'
    Its working fine after changing the conversion as TO_DATE(P_date,'DD/MM/RRRR') .- If we do like this , we need to change in many places , so instead of doing this, is there other solution wrt database settings/Application settings where we can change and fix this issue
    pls help us to solve the issue.
    Regards.
    sathish kWell the solution is right in front of you. As you say, your database environment is set to DD-MON-RR so your database is set to use 2 digit years (something most people moved away from with the millenium bug more than 10 years ago now). You can either change all your code to use RRRR as you've found, or change your database NLS setting to DD-MON-RRRR and change your front end application to pass you a date with 4 digit years so you get e.g. '20-dec-2009'.
    So many people worked hard to resolve the millenium bug issues all those years ago, but still we have people, all these years later, who want to reintroduce the problem. So sad.

Maybe you are looking for

  • Failing recovery..​.so frustratin​g

     I just got a HP Envy 17-j184nr. I also bought a Samsung 850 pro 256gb ssd to go along with it. Made the recovery discs. Put in the ssd and started the recovery process. It got all the way past the part with administrator and the second drive downloa

  • How can I create a continuous movie from multiple slideshows in IDVD6

    I have created 5 seperate slideshows in IDVD because I wanted to fit the audio with specific pictures and then play them all as 1 show. I can't figure out how to continuously play the entire 5 chapters in sequence. If I start 1 chapter, it will bring

  • Need help setting up a mac to mac network (2 machines)

    First, I apologize for the cross posting, but this got no replies in the networking category. I have a new mac mini and I'm struggling to setup a network with the mini that shows my old G5 dual 1.8. The old computer has two internal hard drives. I've

  • How to build in user authorisation in sender soap adapter

    HI , how can i built the user authorisation in sender soap adapter. either in a url or somewhere on the server . if anyone has an idea do let me knwo Thanks Nikhil

  • Certain things are not displaying of pages

    Certain things are not displaying that I know are there. For example, on one of my websites there are 3 banner ads and the bottom of the pages plus there is another line that has ads scrolling across the page, I can see it with IE or Chrome but on Fi