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

SOAP integration with Service Catalog

robbika
Giga Contributor

We have an SOAP integration with the Service Catalog, but it is very complicated and I strongly suspect is not the correct way to do it.

Basically what happens is that a SOAP message comes in and a transform map sets the fields for the Request. The rest of the message is then processed in an After Transform Script to create the Requested Item and then after that there is complicated code to create copies of the variables from the catalog item definition and set them for the newly minted RITM. This is all very complicated and prone to errors.

On the ServiceNow wiki it mentioned using the Cart API. It has a caveat that the cart will be that of the SOAP user for SOAP integrations.

With all this in mind, I have some questions:

1) Is the Cart API the best way to go, instead of our code which has a role-your-own flavour to it?

2) If there is one user for all SOAP interactions, is there a danger that while one request is being processed, the cart is emptied for another concurrent transaction? Or doesn't it work that way? Or if it does work that way, how is this guarded against? (Locks?)

1 ACCEPTED SOLUTION

brian_quinn
ServiceNow Employee
ServiceNow Employee

Robert,



All of that should be possible using the Cart API and building a scripted web service.   The scripted web service can call the Cart API functions and then add the REQ number to the response of the SOAP message.



Thanks


Brian


View solution in original post

8 REPLIES 8

brian_quinn
ServiceNow Employee
ServiceNow Employee

Robert,



If you do convert over to the new Cart API, why would you still need the transform map to create the request for you?  



Thanks


Brian


A long time since I looked at my Community messages.



It is a SOAP integration on a table with a transform map.



I guess instead we could use a scripted SOAP integration and put the cart code in there.


The main things that we would need:



- create a cart


- add items to the cart


- be able to set variable values on items in the cart


- generate the request and be able to send the request number back to the caller in the SOAP response



If this is all doable, then I'd love to replace our SOAP request code.


brian_quinn
ServiceNow Employee
ServiceNow Employee

Robert,



All of that should be possible using the Cart API and building a scripted web service.   The scripted web service can call the Cart API functions and then add the REQ number to the response of the SOAP message.



Thanks


Brian


snowymypet
Tera Contributor

How to pass answers to questions in scripted web services?