Forum Discussion

alexjavarotti's avatar
New Contributor
7 years ago

SoapUI response data does not contain date and time values

During some tests with SoapUI, a program in C# sends the requesting to the Mock Service. The requesting message contains a set of data elements that can be found in the 'Last Request' content in the 'Mock Response Editor'. However, only the data elements that represent Date and Time are not found. The 'Validate' command gives the information that everything is correct.


The program in C# is very simple. The 'Body' contains the data elements, including the Date and Time data elements:


            MaintenanceNoteRequest request = new MaintenanceNoteRequest();
            request.Header = new MaintenanceNoteRequestHeader();
            request.Body = new MaintenanceNoteRequestBody();

            request.Header.GlobalID = "99999";
            request.Header.MessageID = "000001";

            request.Body.NotificationType = "1";
            request.Body.MaintenancePlanningPlant = "Plant1";
            request.Body.Priority = "0";
            request.Body.ReportedBy = "Javarotti";
            request.Body.ShortText = "Short text from VS";
            request.Body.LongText = "Long text from VS";
            request.Body.DateTimeStartMalfunction = System.DateTime.Now;
            request.Body.DateTimeEndMalfunction = System.DateTime.Now;

            SERV_MaintenanceNoteserviceagent agent = new SERV_MaintenanceNoteserviceagent();
            MaintenanceNoteResponse response = agent.OPER_MaintenanceNoteService(request);

            ResponseTextBox.Text = response.Success.MaintenanceNoteNumber;

However, the last request is the following:


<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
      <MaintenanceNoteRequest xmlns="">
            <ShortText>Short text from VS</ShortText>
            <LongText>Long text from VS</LongText>

Would anyone have a suggestion about what is wrong?

2 Replies

  • avidCoder's avatar
    Super Contributor

    I don't think, soapui/readyapi support C# language as of now. You can use JavaScript, Java and Groovy to generate date.

  • Thank for the information 

    After some tests, I found a property of the class 'Body' that enables the sending of that kind of information. The cause of the problem is related to the WSDL file definitions, not to the SoapUI application or the comunication protocol.