- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2015 12:09 PM
TLDR; Given a provided SOAP Message Function from a downloaded WSDL, how do I successfully add in message headers?
First time working with SOAP and I'm completely lost on what is going on. Why the heck can't everyone supply a REST API...?
Anyways, I'm having an issue where I can't figure out how to add a header into some SOAP Message Functions that were created via a downloaded WSDL from Dell.
I have scoured the Wiki and Community posts for a few days and have made no headway whatsoever. I've even gone as far as manually constructing the SOAP message (using info found here), but with no luck.
I'm able to successfully send my messages using 3rd party apps like SoapUI, where I'm given a UI to specify header information, but unfortunately their app doesn't show me how the header is constructed before being sent. At least not in a way that I can translate into ServiceNow. This tells me that the content is correct, I just don't know how to structure it.
Can anyone provide any help or guidance? I can provide the WSDL/Functions and script usage if necessary.
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2015 04:15 AM
Hi,
You can do it in 2 ways
1. Add the header value in SOAP Message -> Operations
Now select the SOAP Message function from the list down, you will see following screen, where you can edit the SOAP request. You can add the API key header as you have done in SOAP UI
Thats it
2. The second way is doing via script
2.1. Create a SOAP Message in ServiceNow.
2.2. While using the created SOAP message while triggering the request, you can add the APPI key as a header with the help of ServiceNow api.
SOAPMessageV2 API - ServiceNow Wiki
4.12 setRequestHeader(String headerName, String headerValue)
Set an HTTP header in the SOAP message to the specified value.
Parameters:
- headerName - (String) the name of the header.
- headerValue - (String) the value to assign to the specified header.
Returns:
- void

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 06:17 AM
Hey Matthew:
I thought I would mention that I have written a series of Community articles on using SoapUI with ServiceNow. Both for SOAP, and REST. These should be helpful with what you are doing.
Mini-Lab: Web Services — Part 1: Using SoapUI to Test ServiceNow WSDL
Mini-Lab: Web Services — Part 2: Using an Encoded Query
Mini-Lab: Web Services — Part 3: Writing a Simple Scripted Web Service
Mini-Lab: Testing REST With SoapUI
Steven.