Forum Discussion

MikeD1's avatar
MikeD1
New Contributor
5 years ago

Using Excel file as input to Soap call. Date issue uses slash separation.

Hi 

 

I'm trying to call a soap method where one of the inputs is a date. All the other input work fine. 

The date-format in the excel sheet is DD-MM-YYYY but when SoapUI Pro reads it, it comes out as DD/MM/YYYY. I.e. it is separated by slashes instead of hyphens. Now the request does not adhere to the xsd schema and hence I cannot send it. 

 

So the question is how do I change the date format of the input in SoapUI?

 

Thanks in advance.

  • Hey MikeD1,

    I'm actually almost 100% positive Vallarasu actually gave you the correct answer.

    The reasons for this is that ReadyAPI! shouldn't be changing anything, it doesn't even include the functionality to change whats been read in without some effort by yourself and seeing as i'm assumimg you haven't created any event handlers, etc. to change the date format, it must be due to Excel.

    Also, Excel doesn't always display the format of the value that is actually being stored, especially with non string types.
    The easiest way to check that excel is the issue would be to source the date value from a notepad file instead....you'll see that whatever is written in file will be picked up by ReadyAPI!

    Excel doesn't always display the value that is represented by the 'type' specified and i know there is an issue with Excel setting the type on a field AFTER the field has had a value in it (google it youll see). You might have to create a new worksheet, set the datatype to what you want and then add the values to it.

    To summarise: excel doesnt necessarily display the value with the type that is set, especially if you try altering the type after a value has been stored in the field. To prove its excel, source the date value from a .txt file (that has no formatting) and youll see whatever value is sourced is what is saved in the text file.

    Cheers,

    Rich
  • Vallalarasu_P's avatar
    Vallalarasu_P
    Frequent Contributor
    Hi Mike,
    The simple way of handling this is by changing the format of excel column as string. Then save the date in required format.So it doesn't auto change during execution.

    Hope this helps

    • MikeD1's avatar
      MikeD1
      New Contributor

      Hi Vallalarasu

       

      Thank you for your reply. 

       

      However your proposed solution does not fix the problem. 

      The problem is that SoapUI changes the dateformat compared to the format in the Excel file and then the request does not validate against the xsd schema. So I cannot send the request.

      I do not have the possibility to change the schema that is validated against. 

       

      Best regards

      Michael

      • richie's avatar
        richie
        Community Hero
        Hey MikeD1,

        I'm actually almost 100% positive Vallarasu actually gave you the correct answer.

        The reasons for this is that ReadyAPI! shouldn't be changing anything, it doesn't even include the functionality to change whats been read in without some effort by yourself and seeing as i'm assumimg you haven't created any event handlers, etc. to change the date format, it must be due to Excel.

        Also, Excel doesn't always display the format of the value that is actually being stored, especially with non string types.
        The easiest way to check that excel is the issue would be to source the date value from a notepad file instead....you'll see that whatever is written in file will be picked up by ReadyAPI!

        Excel doesn't always display the value that is represented by the 'type' specified and i know there is an issue with Excel setting the type on a field AFTER the field has had a value in it (google it youll see). You might have to create a new worksheet, set the datatype to what you want and then add the values to it.

        To summarise: excel doesnt necessarily display the value with the type that is set, especially if you try altering the type after a value has been stored in the field. To prove its excel, source the date value from a .txt file (that has no formatting) and youll see whatever value is sourced is what is saved in the text file.

        Cheers,

        Rich