AnsweredAssumed Answered

How to create requests in Service Catalog via webservice?

Question asked by Albino on Mar 2, 2018
Latest reply on Jul 10, 2018 by Albino

Hi guys,

I'm trying to develop a integration that create new service requests in Service Catalog from a third party app, using the following methods to perform the needed actions:

 

addRequestWithForm - to insert the new request
getRequestItems - to recover the subscriptions detail ids for each form attached
saveForm - to fill the form fields.
submitRequest - to submit the request

 

All offers uses approval process 2 (approval process driven by workflow) , that fire a PAM workflow to validate approval rules after request submission.

When i try to add a request with offer 10243, the method return a error message, but a new request is created and no items are added to it

 

Request:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.soap.usm.ca.com">
<soapenv:Header/>
<soapenv:Body>
<ser:addRequestWithForm soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionID xsi:type="xsd:string">6916ce25-fa61-4d5a-953d-1920343b9d72</sessionID>
<requestData xsi:type="xsd:string">name:Nova solicitacao via WS!priority:3!status:100!req_by_user_id:usr_caitsm!req_for_user_id:usr_caitsm</requestData>
<requestValuesData xsi:type="xsd:string"></requestValuesData>
<requestValuesDataType xsi:type="xsd:string"></requestValuesDataType>
<addedOfferings xsi:type="xsd:string"></addedOfferings>
<addedItems xsi:type="xsd:string">offering_id:10243!rate_item_id:10147!item_id:12985</addedItems>
<formValuesData xsi:type="xsd:string">offering_id:10243</formValuesData>
</ser:addRequestWithForm>
</soapenv:Body>
</soapenv:Envelope>

 

Response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>Exception occurred in get Request Approval List.</faultstring>
<detail>
<ns1:exceptionName xmlns:ns1="http://xml.apache.org/axis/">com.ca.usm.soap.axisInterfaces.WebServiceException</ns1:exceptionName>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">SERVERNAME</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

 

The new request seems like this:

This form need to be added (created via WS using another offering_id):

 

Outcomes