- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 04:51 PM
On a Calgary instance, I'm trying to send a SOAP message to my server. I'm doing this:
var ns = 'https://ismp-testing.mydomain.com/Demo';
var action = 'bye';
var soap = new SOAPEnvelope(action, ns);
var request = new SOAPRequest('https://ismp-testing.mydomain.com/cgi-bin/hibye.pl');
request.setSoapAction(ns + '#' + action);
request.post(soap, true);
gs.print(soap.getHttpStatus());
gs.print(soap.getResponse());
When I run that, the status prints as null and the response is blank. I've printed the XML that the envelope there generates, saved it to a file, and then made a soap call against it via the 'curl' command, and it worked just fine. So that tells me I'm getting the XML that I expect from the SOAPEnvelope. Any ideas why the SOAPRequest part is then failing?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 08:34 PM
See Scripting Outbound SOAP - Versions Prior to Fuji - ServiceNow Wiki
There are different response methods to use based on how you are calling the SOAP message.
Also it seems like you should be calling the response methods from the request object , like request.getResponse() or request.getHttpStatus(); not from the soap object. May be worth a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 08:34 PM
See Scripting Outbound SOAP - Versions Prior to Fuji - ServiceNow Wiki
There are different response methods to use based on how you are calling the SOAP message.
Also it seems like you should be calling the response methods from the request object , like request.getResponse() or request.getHttpStatus(); not from the soap object. May be worth a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 09:18 AM
All three of these result in null being printed.
gs.print(request.getHttpStatus());
gs.print(request.getResponseDoc());
gs.print(request.getErrorMessage());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 10:27 AM
Are you going through the mid server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 10:31 AM
I'm not, no. My original code works perfectly, which the change you pointed out about calling request instead of soap on the responses. The issue is the security team threw up firewalls that I wasn't aware of Once I moved the testing to a box without the firewalls it works perfectly.