Using setMetaData from Doucment2.5

Hi,

I am trying change the metadata (Title, and Descriptions) of images given the GUID and version. I am trying to use the setMetaData method but I am not sure about what to put in the "psXMLRequiredCurrentMetadata" field. Currently, I am using  "Dim requiredXML As String = "<ishfields></ishfields>"" for that field. I do not have any required metadata that the program needs to check so I tried just leaving it empty. Is that the right approach? What should the "psXMLRequiredCurrentMetadata" field be if I do not have any required current metadata.

docClient.SetMetadata(GUID, lstVersions.Item(k), "en-US", "High", updatedXML, requiredXML)

That is how I currently use SetMetaData method. However, I get an error on this line. The exception I get is 'System.ServiceModel.Security.SecurityNegotiationException'  (SOAP negotiation failed). I am not sure if that is because of the psXMLRequiredCurrentMetadata field or not. What could be causing this issue if the account that I am using has admin access meaning I have write access.

Thanks

  • Hi Ikra,

    See TD14 - DocumentObj 2.5 SetMetaData where the explanation reads

    psXMLRequiredCurrentMetadata Metadata XML structure with the metadata that object is required to have set currently. The update of the object is only carried out when the object has exactly the same metadata specification, i.e. the metadata was not changed by someone else.
    so the empty string "" should be enough if you don't want a double check if the object has changed between your last read and this write/SetMetadata operation.
    A SecurityNegotiationException comes from the communication layer, so depending on:
    1. if you use the ASMX (deprecated) or WCF web services
    2. what is the server version
    3. what is the Secure Token Service (STS) you use (e.g ISHSTS, ADFS,...)
    4. is your client app written in .NET?

    In the end it looks like your client is not authenticated. I assume that even a read operation doesn't work either.

    On https://github.com/sdl/ISHRemote you'll find a Windows .NET Framework C# client on top of the WCF API (without .config file usage even). It is a PowerShell library where you could check the code behind New-IshSession and Set-IshDocumentObj

    -Dave