SOAPUI method saveRequest saveRequestItems saveRequestForm for CA Service Catalog

Document ID : KB000125363
Last Modified Date : 28/01/2019
Show Technical Document Details
Introduction:
N/A
Question:
How to use and execute methods in SOAPUI / Webservices.
To create a new request with service option and form details.
Environment:
Windows
Answer:
1a. First, create the initial/empty 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:saveRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionID xsi:type="xsd:string">8dc7b70b-d514-4fe8-aa8c-cd316ac8e1b6</sessionID>
         <requestData xsi:type="xsd:string">name: ABAKUS: REQ0030198 - RITM0042146|created_date:2017-07-31 04:25:56|desired_date:|priority:4|req_by_user_id:spadmin|req_for_user_id:<userid>|comments:ServiceNow SYS_ID:CAT001371</requestData>
         <requestValuesData xsi:type="xsd:string">authorization_number:RITM0042146|project:CAT001371|gl_code:88888|cost_center:(set on the form)|ship_to_address1:N/A|ship_to_city:N/A|ship_to_state:N/A|ship_to_postal:N/A|ship_to_country:N/A</requestValuesData>
         <requestValuesDataType xsi:type="xsd:string"></requestValuesDataType>
         <addedOfferings xsi:type="xsd:string"></addedOfferings>
         <removedOfferings xsi:type="xsd:string"></removedOfferings>
         <addedItems xsi:type="xsd:string"></addedItems>
      </ser:saveRequest>
   </soapenv:Body>
</soapenv:Envelope>
1b. Result: <requestID xsi:type="xsd:int">10167</requestID>

2a. Next is to save the service option into the request:
SELECT o.offering_id, o.offering_name,
rp.rate_plan_id, rp.status,rp.date_available, rp.is_inherited, rp.total_rows, rp.total_cols,rp.domain,rp.sort_order_no,rp.rate_plan_name,rp.description, 
ori.id as iid, ori.layout as layout  
FROM  usm_offering o, usm_rate_plan rp,usm_offering_rplan_inclusion ori 
WHERE o.offering_name = 'SOAP-Offering'
AND ori.parent_id=o.offering_id 
AND rp.rate_plan_id=ori.child_id 
AND rp.status in (1,6)
2b. Result: 10248 SOAP-Offering 10171 ~ Order of Service

<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:saveRequestItems soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionID xsi:type="xsd:string">8dc7b70b-d514-4fe8-aa8c-cd316ac8e1b6</sessionID>
from 1b.         <requestID xsi:type="xsd:int">10167</requestID>
from 2b.         <addedOfferings xsi:type="xsd:string">offering_id:10248</addedOfferings>
         <removedOfferings xsi:type="xsd:string"></removedOfferings>
         <addedItems xsi:type="xsd:string"></addedItems>
      </ser:saveRequestItems>
   </soapenv:Body>
</soapenv:Envelope>

3a. Next is to fill out the attached service option form.
select id from usm_subscription_detail where request_id=10167 and subscription_type=5
3b. Result: 10703

<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:saveRequestForm soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionID xsi:type="xsd:string">8dc7b70b-d514-4fe8-aa8c-cd316ac8e1b6</sessionID>
from 3b.         <subscriptionDetailID xsi:type="xsd:int">10703</subscriptionDetailID>
         <formValuesData xsi:type="xsd:string">pri_phone_number:9932431|email_address:name@maildomain.com|first_name:Fname|last_name:Lname|userid:<userid></formValuesData>
      </ser:saveRequestForm>
   </soapenv:Body>
</soapenv:Envelope>
3c. Result: NO error.
3d. With:
<formValuesData xsi:type="xsd:string">pri_phone_number:9932431|email_address:email@maildomain.com|first_name:Fname|last_name:Lname|userid:<userid></formValuesData>
3e. It works okay.

4a. Add "|FromDate:" (empty date value) and you'll get an error.
<formValuesData xsi:type="xsd:string">pri_phone_number:9932431|email_address:email@maildomain.com|first_name:Fname|last_name:Lname|userid:<userid>|FromDate:</formValuesData>

4b. Add "|FromDate:08/04/2017" (non-empty date value) and you'll get an error.
<formValuesData xsi:type="xsd:string">pri_phone_number:9932431|email_address:email@maildomain.com|first_name:Fname|last_name:Lname|userid:<userid>|FromDate:08/04/2017 0:0:0</formValuesData>
4c. All runs okay again.
4d. Date fields may not be empty. All 'date' fields have to be given a value. 
The date value must be composed of date & time (08/04/2017 0:0:0)