SOAP message function ERROR: String was not recognized as a valid DateTime

Felipe Morais
Tera Contributor

Hello guys,

 

I'm trying to communicate with SAP services but I'm getting the following error message when i test my SOAP message function (SPF)

FelipeMorais_0-1700493139391.png

Basically, I have a variable named Entertime in line 84 of my SPF which is not being recognized as a valid DateTime.

In the "WSDL XML" field of my SOAP message this variable is defined with a type of Time
FelipeMorais_3-1700493588770.png


I know that the time format expected is hh:mm:ss. So I tried to test by setting this format for Entertime in the UI Action which triggers the SAP communication, 
FelipeMorais_1-1700493387045.png

But i still get the same error, and I'm not sure what is the issue with this Entertime variable.

3 REPLIES 3

Tony Chatfield1
Kilo Patron

Hi, your response message indicates that the string was not recognized as a valid Date\Time, but your code shows you are only passing in a time value, have you confirmed the target platforms expectations?
Time may be hh:mm:ss but there can be other variations like hh:mm:ss.sss and some platforms call for an epoch date\time IE 1970-01-01 10:30:59 or possibly epoch represented as unix time IE seconds or milliseconds from 1970-01-01 00:00:00 which for 10:30:59 would be 37859

Yes, the expected value is in the hh:mm:ss format. Here's an example of how the Entertime appears on the SAP platform for the 3rd-party:
FelipeMorais_0-1700558845892.png

 

Hi, can you see the sent payload? does it look correct?
The doc's show getByFormat() returns a string, so I don't see any obvious issue, but you could stringy the result to be sure, and\or use 'typeof' to debug and confirm that data type, as well as logging the value.

 

If the payload looks correct, then perhaps the issue is with the target platform not with the SNC generated payload.