Please note: On Sunday 16th May 00AM – 04AM CEST we will be performing planned maintenance on the RWS Community website. During this time you will not be able to access the website and post/reply. Apologies for the inconvenience.

Changing metadata of an image object using DocumentObj 2.5 SetMetaData

I'm wring a PowerShell script to change objects metadata at once. My script woks properly for topic objects. However, it does not work for image objects. I wrote the following code to change metadata using DocumentObj 2.5.

function DocumentObj-SetMetaData()
{
  $functionName = "DocumentObj-SetMetaData"
  $documentObjUrl = $infosharewsurl + "DocumentObj25.asmx?WSDL"
  $documentObjWebService = new-webServiceProxy -uri $documentObjUrl -UseDefaultCredential
  try
  {
    $psXMLMetadata = "<ishfields>"
    $psXMLMetadata += "<ishfield name='FTITLE' level='logical'>" + $ftitle + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTAMODELCLASSIFICATION' level='version'>" + $classification + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTAMODELSERIES' level='version'>" + $modelseries + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTAMODEL' level='version'>" + $model + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTAREGION' level='version'>" + $region + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTACOUNTRY' level='version'>" + $country + "</ishfield>"
    $psXMLMetadata += "<ishfield name='FKUBOTAKEYWORD' level='version'>" + $keywords + "</ishfield>"
    $psXMLMetadata += "</ishfields>"
  
    $psXMLRequiredCurrentMetadata = "<ishfields/>"
  
    # Write-Host($psXMLMetadata)
    Write-Host($id)
    $result = $documentObjWebService.SetMetaData([REF]$context, $id, [REF]$version, $language, $resolution, $psXMLMetadata, $psXMLRequiredCurrentMetadata)
  }
  catch [System.Web.Services.Protocols.SOAPException]
  {
    ("error at " + $functionName)
      Return-Result $Error[0].Exception.InnerException.Message
  }

  $result #returning the function value by simply outputting it
}
When this function is called, following ishfields are given via $psXMLMetadata variable.
<ishfields>
  <ishfield name='FTITLE' level='logical'>OM-GUIDE-0001</ishfield>
  <ishfield name='FKUBOTAMODELCLASSIFICATION' level='version'></ishfield>
  <ishfield name='FKUBOTAMODELSERIES' level='version'></ishfield>
  <ishfield name='FKUBOTAMODEL' level='version'></ishfield>
  <ishfield name='FKUBOTAREGION' level='version'></ishfield>
  <ishfield name='FKUBOTACOUNTRY' level='version'></ishfield>
  <ishfield name='FKUBOTAKEYWORD' level='version'>guide</ishfield>
  <ishfield name='FRESOLUTION' level='lng'>Thumbnail</ishfield>
</ishfields>
An exception occurs when the $documentObjWebService.SetMetaData is executed and it returns '-102003' as the error code. I looked into the error code explanation in the following page. But I cannot figure out the reason of the error.
Please give me advises to resolve this issue.
Kind regards,
Naoki