Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
REST Outbound integration fails with Error constructing REST Message - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • REST Outbound integration fails with Error constructing REST Message
KB0713087

REST Outbound integration fails with Error constructing REST Message


13186 Views Last updated : Jul 22, 2025 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

An Outbound REST Integration call may fails when calling a REST Message from script, but may work fine when testing the related REST Message from System Web Services > Outbound > REST Message.

The system logs will display the below error:
REST Msg Outbound - RESTMessageClient : Error constructing REST Message/Method: incident/post: com.glide.generators.InvalidGlideRecordException: REST message/method 'incident/post' not found in table 'sys_rest_message_fn': com.glide.rest.outbound.RESTMessageDAO.getMethodRecord(RESTMessageDAO.java:97)
com.glide.rest.outbound.RESTMessageDAO.<init>(RESTMessageDAO.java:72)
com.glide.rest.outbound.RESTMessageDAO.newInstance(RESTMessageDAO.java:67)
com.glide.rest.outbound.RESTMessageConfig.initNew(RESTMessageConfig.java:66)
com.glide.rest.outbound.RESTMessageClient.<init>(RESTMessageClient.java:54)
com.glide.rest.outbound.scriptable.ScriptableRESTMessageClient.<init>(ScriptableRESTMessageClient.java:56)
com.glide.rest.outbound.scriptable.ScriptableRESTMessageClient.jsConstructor(ScriptableRESTMessageClient.java:40)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:670)
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:559)
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:491)
org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:403)
org.mozilla.javascript.ScriptRuntime.newObject(ScriptRuntime.java:2449)
org.mozilla.javascript.ScriptRuntime.newObjectEx(ScriptRuntime.java:2464)
org.mozilla.javascript.gen.null_null_script_1392._c_script_0(null.null.script:6)
org.mozilla.javascript.gen.null_null_script_1392.call(null.null.script)
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:563)
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3421)
org.mozilla.javascript.gen.null_null_script_1392.call(null.null.script)
org.mozilla.javascript.gen.null_null_script_1392.exec(null.null.script)
com.glide.script.ScriptEvaluator.execute(ScriptEvaluator.java:263)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:110)
com.glide.script.ScriptEvaluator.evaluateString(ScriptEvaluator.java:76)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:343)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:263)
com.glide.script.fencing.GlideScopedEvaluator.evaluateScript(GlideScopedEvaluator.java:250)
com.glide.processors.ScriptProcessor.evaluateScript(ScriptProcessor.java:330)
com.glide.processors.ScriptProcessor.runScript(ScriptProcessor.java:219)
com.glide.processors.ScriptProcessor.process(ScriptProcessor.java:177)
com.glide.processors.AProcessor.runProcessor(AProcessor.java:474)
com.glide.processors.AProcessor.processTransaction(AProcessor.java:199)
com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:178)
com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:167)
com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:31)
com.glide.sys.Transaction.run(Transaction.java:2037)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Cause

This is due to the HTTP Method name being passed from the script, not matching with the actual Function name which belongs to the related REST Message.

In this case the REST Message function name was Insert Incident for the corresponding HTTP Method (POST), however in the script it is being used as post, which does not exist and causes the issue.

Resolution

Correct the REST Message function name in the source script as follows:

from:
var r = new sn_ws.RESTMessageV2('incident', 'post');

to:
var r = new sn_ws.RESTMessageV2('incident', 'Insert Incident');

 

It is not relevant what name you choose for your REST Message function (sys_rest_message_fn) against the corresponding HTTP Method. The important point is to use the same name when invoking that REST Message function in your script. Besides, whenever you rename a REST Message function, make sure to rename it in the related scripts as well, so to avoid such issues proactively.


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.