The CreatorCon Call for Content is officially open! Get started here.

Outbound REST Message returns 500

charliesdev
Giga Expert

I have a hosted REST endpoint that can be successfully hit from:

web:   https://webopstest.osmose.com/MgmtToolsApi/api/Authorization/AuthorizationTokenAsJSON/17/serv_utilii...

fiddle: https://jsfiddle.net/48o0xgxq/2/  

and Postman, iPhone, etc

But testing it using a REST Message object always fails with 500.

I see in my server log (on webopstest) that the endpoint is being hit from servicenow and returns 200.

it's a simple 'get' with no authentication.   should just return a string wrapped in a JSON object.

I'm on Istanbul, build 6 I believe.   Oh, also I'm a n00b, so don't assume that I haven't missed something simple.

1 ACCEPTED SOLUTION

mohamadcharafed
ServiceNow Employee
ServiceNow Employee

Hi Charlie,



It looks like your certificate is using SNI which is not supported until Jakarta


If you have a Jakarta instance set 'glide.outbound.tls_sni.enabled' property to true and test your endpoint and it will work. (this property wont work on instances before jakarta)



Cheers


Mohamad


View solution in original post

29 REPLIES 29

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Charlie,



Do you mind sharing the code which invokes the REST End Point?



Thanks


Antin


My plan is to invoke it from a Scheduled Script Execution, but haven't done that yet.


I'm just testing the Message from the "Test" Related Link.


The endpoint for the Message is


https://webopstest.osmose.com/MgmtToolsApi/api/Authorization/AuthorizationTokenAsJSON/17/serv_utilii...


there are no headers defined, and no authentication.



the Method is a 'GET' with the same endpoint.   authentication is set to 'inherit' and there is one header:


Accept: application/json



There was a suggestion that it was a CORS issue and there are no CORS Rules defined.


I looked into defining one but I don't see a "REST API" that seems applicable to what I'm doing.


We changed the endpoint on webopstest.osmose.com to have a CORS policy, but it didn't help.


antin_s
ServiceNow Employee
ServiceNow Employee

Got it.



Is it working when you try 3rd party tools like Soap UI or any other REST Clients?


It works from here:   https://jsfiddle.net/jjtnzp7m/10/


which is different than the original fiddle.