"INVALID AHD07131: sync_fetch error AHD03049:Bad input parameter" when calling createObject in SDM SOAP API Powershell
search cancel

"INVALID AHD07131: sync_fetch error AHD03049:Bad input parameter" when calling createObject in SDM SOAP API Powershell

book

Article ID: 241710

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

Attempting to populate the CMDB via a script that pulls data from one MDR, generates the CI using SDM's SOAP API, and then generates the MDR button using a second call. 

My powershell script is as follows.

Function SDMCreateMDRs {
    $emptyArray = @();
    [ref]$cret="";
    [ref]$handle="";
    for ($i=1; $i -lt $foundServers.Count; $i++){
        $Vals=@('delete_flag','0','mdr_provider_id','400001','federated_asset_id',"$($variablename)",'cmdb_asset_id',"$($fServerIDs)");$SDResults=$SDMProxy.createObject($sid, 'ci_mdr_idmap', $Vals, $emptyArray, $cret, $handle);
    }
}

The response is this. 

Exception calling "createObject" with "6" argument(s): "INVALID AHD07131:sync_fetch error AHD03049:Bad input parameter"

Able to target the ci_mdr_idmap object using a doSelect call, but the createObject call for some reason fails for ci_md_idmap. Can run the createObject call with the NR object just fine.

Environment

Release : 17.3 or higher

Component : SDM - Configuration

Cause

In the code, it's referencing "$($variablename)", but the variable expects a list.  

Resolution

SDM is expecting a single string, so the code needed to be "$(($variablename)[$i])" instead.

Additional Information

The above is an example specific to Powershell scripting.  Broadcom is not permitted to assist in developing or debugging custom code or porting any existing code samples.