Topic
  • 3 replies
  • Latest Post - ‏2012-04-23T15:26:07Z by turkleton
MalcolmWaring
MalcolmWaring
4 Posts

Pinned topic Error while trying to update uri on a URL (c#)

‏2011-08-18T21:03:47Z |
This is part of some test code I am trying to convert from Java.

On the last line it fails with:
CM-REQ-4192 The property "name" (for an object of class "URL") is incorrect.

I have been able to update DataSourceConnection connectionstrings without problem. What am I doing wrong? I figure it's simple.

Thanks,

Malcolm


searchPathMultipleObject sp = 

new searchPathMultipleObject();   sp.Value = folderPath;   baseClass[] cogUrl = CogSvc.query(sp, getAllPropEnum(), 

new sort[] 
{ 
}, 

new queryOptions()); URL url = (URL)cogUrl[0];   string currentUri = url.uri.value;   string newUri = currentUri += 
"TEST";   anyURIProp aupr = 

new anyURIProp();   aupr.value = newUri;   url.uri = aupr;   CogSvc.update(

new baseClass[] 
{ url 
}, 

new updateOptions());
Updated on 2012-04-23T15:26:07Z at 2012-04-23T15:26:07Z by turkleton
  • MalcolmWaring
    MalcolmWaring
    4 Posts

    Re: Error while trying to update uri on a URL (c#)

    ‏2011-08-25T14:56:03Z  
    Anyone have a hint? Possible C# sample code for updating the URI?

    This has to be something simple that I botched when reverse engineering the java sample.
  • MalcolmWaring
    MalcolmWaring
    4 Posts

    Re: Error while trying to update uri on a URL (c#)

    ‏2011-09-07T14:48:52Z  
    OK, figured it out.

    getAllPropEnum() came from the java example and it contains a list of all propEnums including "name" which apparently isn't valid even though you can see it in the debugger.

    So if you see a similar error message when doing any update and you are not trying to update the property in the error message, check what you are using for propEnum.
  • turkleton
    turkleton
    1 Post

    Re: Error while trying to update uri on a URL (c#)

    ‏2012-04-23T15:26:07Z  
    OK, figured it out.

    getAllPropEnum() came from the java example and it contains a list of all propEnums including "name" which apparently isn't valid even though you can see it in the debugger.

    So if you see a similar error message when doing any update and you are not trying to update the property in the error message, check what you are using for propEnum.
    Thanks so much for this post. I was having the same exact issue. I was pulling propEnum.name and that was causing the "update" to fail.