Set the HTTP status in scripted soap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 04:31 AM
I am working on a scripted soap message and am trying to figure out how to set the HTTP status and show there is an error. I am able to do it in REST without issues but I do not see any documentation for how to do it in SOAP. Has anybody done this before?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 04:40 AM
If you want to send back a custom error code in SOAP response of scripted SOAP WS: below will help:
SOAP in ServiceNow: Practice and Learn
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 05:03 AM
Thank you for the document. I am already sending back a custom response but I am trying to figure out how to set the http status. How do I set the http status in the response?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 05:25 AM
Hi Paul,
I don't think you can set the http status for scripted soap. you can do that for scripted rest.
RESTAPIResponse - setStatus(Number status)
Try using scripted rest to get complete control over your response
Changing soap response header in scripted webservice
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 08:03 AM
Hi Paul,
Any update on this?
Could you mark the answer as correct, helpful and hit like if you were able to achieve the requirement. This also helps in removing the question from unanswered list. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader