The CreatorCon Call for Content is officially open! Get started here.

How to print the request Body in SOAP Message?

suman12
Tera Contributor

Hi all,

 

Building the SOAP outbound in scoped application, Please guide me to put log the requestBody before hitting the endpoint.

Using the below code geeting null value

 var s = new sn_ws.SOAPMessageV2('Some string','somestring');

 var requestBody = s.getRequestBody();

  gs.info('requestBody ' + requestBody);

output: getting null instead of body

 

Thanks

6 REPLIES 6

Community Alums
Not applicable

Hi,

You can try to print the request body once you add the line which executed the API i.e. after

var response = s.execute();

 

Please mark reply as Helpful/Correct, if applicable. Thanks!

Thanks Akshay.It worked

Community Alums
Not applicable

Hello Suman,

Glad to know it's working for you.

Please mark reply as Correct, if applicable. Thanks!

Community Alums
Not applicable

Hello,

 Glad to know my answer worked for you. Please mark reply as Correct so it will be helpful for others looking for similar query.