Response XML from soap message returning undefined for both error_message and status
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2015 10:45 AM
I have this response fields written in Transform Map Script in the Web Service
response.number = target.u_external_ticket_id;
response.u_external_ticket_id = target.number;
response.data_flow_direction = true;
response.status = response.status;
response.error_message = response.error_message;
<?xml version='1.0' encoding='UTF-8'?><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_saveincident"><sys_id>30639cdf0f12420078bbdb0be1050e9a</sys_id><table>incident</table><display_name>number</display_name><display_value>IN15000447610</display_value><status>updated</status><u_external_ticket_id>IN15000447610</u_external_ticket_id><number>101210</number><error_message>org.mozilla.javascript.Undefined@49fec1</error_message><status>org.mozilla.javascript.Undefined@49fec1</status><data_flow_direction>true</data_flow_direction></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
<error_message>org.mozilla.javascript.Undefined@49fec1</error_message>
<status>org.mozilla.javascript.Undefined@49fec1</status>
But not sure why i am getting undefined in both error_message and status?
Please advise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2015 08:56 AM
Hi Dinesh,
I just observed one thing from your initial post, You have status tag multiple times in the response
<?xml version='1.0' encoding='UTF-8'?><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_saveincident"><sys_id>30639cdf0f12420078bbdb0be1050e9a</sys_id><table>incident</table><display_name>number</display_name><display_value>IN15000447610</display_value><status>updated</status><u_external_ticket_id>IN15000447610</u_external_ticket_id><number>101210</number><error_message>org.mozilla.javascript.Undefined@49fec1</error_message><status>org.mozilla.javascript.Undefined@49fec1</status><data_flow_direction>true</data_flow_direction></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
It seems like it is happening out of the box (to show the status value) according to whether it is inserted or updated(I am not sure about other status, You can try on them).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2016 12:21 AM
Hi Dinesh,
Instead of writing below loc
response.error_message = response.error_message;
write:
response.error_message = "Your desired error message";