Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Soap Response Logging

ctsmith
Mega Sage

External web services makes a SOAP call into our instance to create an incident.   We send a SOAP response back.   I can't seem to find this outbound SOAP response logged anywhere.   And where is this response formatted/created?   Since it's a seemingly out of the box incident SOAP response, do we not have access to it?   Is this a scripted web service not visible to admins?


Thanks!

Chris

7 REPLIES 7

Mike Allen
Mega Sage

The code that composes the response is not accessible.   I have tried to edit it in the past to add output parameters and could not.   I have never thought to look for a log of the response, but if I find one, I'll tell you.


Hi Mike - did you ever find a way to edit the response of an ootb table web service?



I'd like to add field fields such as a status and error message to the response but can't find anything on how to edit the wsdl.



Thanks,


Arjen


I found a way in (sadly not OOB tables so far) transform scripts, but it doesn't seem to be working correctly.   I've opened a ticket with HI as it seems other users are running into the issue.



Web Service Import Sets - ServiceNow Wiki



Status and Error messages:



Transform Map Scripts - ServiceNow Wiki


Even weirder, I have a custom SOAP response that is both a success and a failure at the same time. An onBefore Transform script:



error = [];


//error_message = "oops";


//status_message = "There is no error.   Move along";


response.RequestNumber = rc.number;


response.RequestSysID = rc.sys_id;


//gs.log(error);



The result:


<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


    <SOAP-ENV:Body>


          <insertResponse xmlns="http://www.service-now.com/u_esb_integration_request">


                <sys_id/>


                <table>sc_cat_item</table>


                <display_name/>


                <display_value/>


                <status>error</status>


                <RequestNumber>REQ83063</RequestNumber>


                <RequestSysID>71abxxf9132772000ec059722244b0e5</RequestSysID>


                <status_message>Success</status_message>


                <error_message>onBefore script error.</error_message>


          </insertResponse>


    </SOAP-ENV:Body>


</SOAP-ENV:Envelope>



So, it's still giving me my custom SOAP response, but it also says my script has an error.  



This is very confusing:


<status_message>Success</status_message>


<error_message>onBefore script error.</error_message>