Can we use direct webservice to update the record in soap?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 03:53 AM
I have used import set row, I am able to insert into target instance. But the problem is I am unable to update the record with the sys_id. I am getting an error as Web service update called for a missing record: 3e3f49f14f03520097f8f5a18110c797</faultstring><detail>com.glide.processors.soap.SOAPProcessingException: Web service update called for a missing record:
So I gave direct web service link in SOAP Endpoint as https://devXXXX.service-now.com/incident.do?SOAP to achieve the functionality.
Can we do like this. Is this is the best practice to do. What are the pros and cons for this.
If this is not the right way. How to update the record from source to target with SOAP?
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 04:25 AM
To update the records in target table you need to use coalesce feature in servicenow.
More here Using the Coalesce Field - ServiceNow Wiki
Thanks
Srini
Mark this answer as correct/helpful if it does so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 04:49 AM
Hi Srini,
When I keep the coalesce field and tried to insert into the target I am getting the error as
<?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_demo_instance"><sys_id>dc7359f5db0f5600c5a8f8c0cf961914</sys_id><table>u_demo_instance</table><display_name>sys_import_row</display_name><display_value>5</display_value><status>skipped</status><status_message>Unable to resolve target record, coalesce values not present: number</status_message><error_message>Unable to resolve target record, coalesce values not present: number</error_message></insertResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
So I removed coalesce field in the stage table i.e web service table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 05:45 AM
If you are Coalescing on number, sys_id field then check Coalesce on empty fields check box on the field map
Hope that helps
Srini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 07:41 AM
ImportSet Web Services works like following way
1. Staging table should contain the coalesce field (any field which makes the record unique) and mapped to target table with --check the checkbox with "Coalesce on empty fields" in the mapping assist (IMPORTANT).
2. If webservice consumer do NOT send any value in the coalesce field, it will be considered as INSERT and new record will be inserted in target table.
3. If webservice consumer sends SOME value in the coalesce field it will try to match the record in the target table to UPDATE it, it happened in your example and it didn't find any record with the coalesce field, so it returned the error.
To insert follow 1 & 2.