SOAP message function | HTTP 500 Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 07:37 AM
Hello guys,
I am facing an issue with connecting SAP/SOAP services. When I test my SOAP message function i get an 500 Error the response is the following:
When I comment line 84, the HTTP status is 200, so the 500 Error comes from the Entertime variable.
From what I could get from the error message (first image), the 3rd-party expects to receive a DateTime value, but they receive a String value instead.
I suppose that it has to do with how the type of the parameter Entertime is defined. In the SOAP message, the "type" of Entertime is time, but for all other variables, its defined as string type, but I'm not sure why.
In the UI Action (button) that calls the service, some variables are defined with the "setStringParameterNoEscape" function**.
So I tried to add this code snipplet (circumscribed in red) to define the Entertime as a parameter of the type DateTime/Time (as i was supossed to be) using GlideTime() and GlideDateTime() methods, but both didn't work.
** But i could not find where this "setStringParameterNoEscape" function is defined in the instance.
What am I missing here? I think maybe the setStringParameterNoEscape function forces the Entertime to be a string, but I'm not sure.
Thanks,
FLM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 07:47 AM
I believe when you send the GlideDateTime() servicenow sends the date in default system format (YYYY-MM-DD HH:MM:SS), please check with your thirdparty team what is the format accepted and convert your datetime to that format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 07:57 AM - edited 11-17-2023 07:58 AM
The thing is, before I add the code snippet which includes the "GlideDateTime()" I was facing the same issue. I only shared this to show what i have tried to solve the problem, and to show it did not work. But I'll check with the 3rdparty what is the expected format. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2023 08:01 AM
The expected format is the following

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 01:39 AM
SetString parameter is defined in the SOAP Message script include which comes OOB. You can customize by copying this if needed and use it in your SOAP message call. Please refer the screenshot below of the OOB SOAP Message script include.
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers!