Unable to read tran:payload / raw SOAP body in Inbound Scripted SOAP Web Service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Below is the sample XML:-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hey my Friend
What your running into is a pretty common issue with Scripted SOAP services, and it usually comes down to how ServiceNow handles the raw SOAP body and XML namespaces.
From what I’ve seen, ServiceNow doesn’t reliably expose the nested SOAP body for you to read directly, especially when the payload is wrapped in multiple namespaces like tran and star. Even though the message is well-formed and reaches the endpoint, you still need to manually parse the raw SOAP envelope.
The approach that’s worked for me is:
Read the raw request body instead of relying on any mapped body object.
Parse it yourself using XMLDocument2.
Use namespace-agnostic XPath (for example, local-name()) so you’re not blocked by prefix differences.
That lets you reliably drill down into:
ProcessMessage → payload → content → ProcessRepairOrder, regardless of the actual namespace prefixes.
One other thing I’d double-check is whether the XML inside <tran:content> is truly nested XML (like in your example) or escaped as text. If it’s escaped, you have to extract the text, unescape it, and then parse it again as XML. That’s a very common transport pattern and will make it look like the node “doesn’t exist” if you try to XPath directly to it.
Bottom line: this isn’t a SOAP 1.1 issue or a Postman issue — it’s just that Scripted SOAP doesn’t do namespace resolution or deep payload parsing for you. Once you grab the raw body and use namespace-agnostic parsing, you should be able to access the XML under <tran:payload> without changing the source system or moving away from SOAP.
@ShoelM - Please mark Accepted Solution and Thumbs Up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Thanks for the detailed response and for sharing your experience — really appreciate it.
Is there any way to get this raw XML to the instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
You’re not doing anything wrong. Inbound Scripted SOAP does not expose the raw SOAP envelope at all. By the time your script runs, ServiceNow has already parsed and discarded it so request.body, getBody(), etc. being empty is by design.
There is no supported way to access the raw XML in a Scripted SOAP Web Service.
If you need the full SOAP envelope for namespace-agnostic parsing, dynamic payloads and the practical solution is to use Scripted REST and accept the SOAP XML there. That’s what most teams end up doing.
Bottom line: raw SOAP access = not possible with Scripted SOAP in ServiceNow.
@ShoelM - Please mark Accepted Solution and Thumbs Up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
How to get raw XML
