Deleting a site-level value of a substitution parameter

There is a use case where one needs to delete a site-level substitution parameter definition and run the test on a given site with the default value of the substitution parameter. Site-level substitution parameters can be deleted through the Test Management API. Global substitution parameters cannot be deleted, because the Test Management API cannot manage substitution parameter references; only the Recorder can do that.

To delete a site-level substitution parameter, issue a request similar to the following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:AddOrUpdateSubstitutionParametersRequest>
         <prov:Credentials>
            <prov:UserName>testuser</prov:UserName>
            <prov:Password>testpassword</prov:Password>
         </prov:Credentials>
         <prov:ParameterizedMonitor monitorId="326334">
            <prov:MonitorSites>
               <prov:MonitorSite siteId="880">
                  <prov:SubstitutionParameters>
               	     <prov:SubstitutionParameter id="2"
                                                 name="Password"
                                                 value="password12"
                                                 deletionFlag="On"/>
                  </prov:SubstitutionParameters>
               </prov:MonitorSite>
            </prov:MonitorSites>
         </prov:ParameterizedMonitor>
      </prov:AddOrUpdateSubstitutionParametersRequest>
   </soapenv:Body>
</soapenv:Envelope>

The inclusion of the deletionFlag in the SubstitutionParameter definition will cause the substitution parameter to be deleted. However, including the deletionFlag in a global substitution parameter will generate an error. For example, the following request is invalid:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:prov="http://www.gomeznetworks.com/schemas/provisioning">
   <soapenv:Header/>
   <soapenv:Body>
      <prov:AddOrUpdateSubstitutionParametersRequest>
         <prov:Credentials>
            <prov:UserName>testuser</prov:UserName>
            <prov:Password>testpassword</prov:Password>
         </prov:Credentials>
         <prov:ParameterizedMonitor monitorId="326334">
            <prov:SubstitutionParameters>
               <prov:SubstitutionParameter id="1"
                                           name="UserName"
                                           value="MyUsername"
                                           deletionFlag="On"/>
            </prov:SubstitutionParameters>
         </prov:ParameterizedMonitor>
      </prov:AddOrUpdateSubstitutionParametersRequest>
   </soapenv:Body>
</soapenv:Envelope>

This following is how the error message would appear:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <AddOrUpdateSubstitutionParametersResponse
           xmlns="http://www.gomeznetworks.com/schemas/provisioning">
         <ResponseStatus>FAILURE</ResponseStatus>
         <ErrorMessage>A global substitution parameter may not be deleted!
									</ErrorMessage>
      </AddOrUpdateSubstitutionParametersResponse>
   </soap:Body>
</soap:Envelope>