Showing results for 
Search instead for 
Did you mean: 

GetItemAndRelatedObjects c#

 public void xGetItemAndRelatedObjects(string itemID)
            itemID = "P00000333";
            DataManagementService dmService = DataManagementService.getService(Session.getConnection());
            GetItemAndRelatedObjectsInfo[] getInfos = new GetItemAndRelatedObjectsInfo[1];
            GetItemAndRelatedObjectsInfo getInfo = new GetItemAndRelatedObjectsInfo();
            ItemInfo iteminfo = new ItemInfo();

            getInfo.ClientId = "MYTEST";
            iteminfo.ClientId = "MYTEST";
            iteminfo.UseIdFirst = true;

            AttrInfo[] attrInfos = new AttrInfo[1];
            AttrInfo attrInfo = new AttrInfo();
            attrInfo.Name = "ITEMID";
            attrInfo.Value = itemID;

            attrInfos[0] = attrInfo;

            iteminfo.Ids = attrInfos;

            getInfo.ItemInfo = iteminfo;

            DatasetRelationFilter[] filters = new DatasetRelationFilter[1];
            filters[0] = new DatasetRelationFilter();
            filters[0].DatasetTypeName = "DWG";    
            filters[0].RelationTypeName = "IMAN_reference";
            getInfo.DatasetInfo.Filter.RelationFilters = filters;

            getInfos[0] = getInfo;
            GetItemAndRelatedObjectsResponse response = dmService.GetItemAndRelatedObjects(getInfos);  // error in DOM parsing

            GetItemAndRelatedObjectsItemOutput[] outputs = response.Output;



need some hlp, cannot find my mistake in prog

TC11 Vs2015 

I'm trying to get the infos for a itemId. It works until I call the service.getitemandrelatedObjects.

there is the error  'error parsing DOM' . Seems the getInfo-class is not correct. 

Sorry can't see my error.

Thanks for any help




Re: GetItemAndRelatedObjects c#

Siemens Phenom Siemens Phenom
Siemens Phenom


As I did something similiar I defined RevInfo and I do not see information about the revision in your code. Maybe worth giving it a try.


Re: GetItemAndRelatedObjects c#


thanx, haven't seen, the is also a DatasetInfo

I added this to the prog


public void xGetItemAndRelatedObjects(string itemID)
          itemID = "P00000333";
          DataManagementService dmService = DataManagementService.getService(Session.getConnection());
          GetItemAndRelatedObjectsInfo[] getInfos = new GetItemAndRelatedObjectsInfo[1];
          GetItemAndRelatedObjectsInfo getInfo = new GetItemAndRelatedObjectsInfo();
          ItemInfo iteminfo = new ItemInfo();
          getInfo.ClientId = "MYTEST";
          RevInfo refinfo = new RevInfo();
          refinfo.NRevs = 0;
          getInfo.RevInfo = refinfo;
          DatasetInfo datasetinfo = new DatasetInfo();
          getInfo.DatasetInfo = datasetinfo;
          iteminfo.ClientId = "MYTEST";
          iteminfo.UseIdFirst = true;
          AttrInfo[] attrInfos = new AttrInfo[1];
          AttrInfo attrInfo = new AttrInfo();
          attrInfo.Name = "ITEMID";
          attrInfo.Value = itemID;
          attrInfos[0] = attrInfo;
          iteminfo.Ids = attrInfos;
          getInfo.ItemInfo = iteminfo;
          DatasetRelationFilter[] filters = new DatasetRelationFilter[1];
          filters[0] = new DatasetRelationFilter();
          filters[0].DatasetTypeName = "DWG";    
          filters[0].RelationTypeName = "IMAN_reference";
          getInfo.DatasetInfo.Filter.RelationFilters = filters;
          getInfos[0] = getInfo;
          GetItemAndRelatedObjectsResponse response = dmService.GetItemAndRelatedObjects(getInfos);  // error in DOM parsing
          GetItemAndRelatedObjectsItemOutput[] outputs = response.Output;

but no luck, error stays the same :-(



Re: GetItemAndRelatedObjects c#


Please change this line

attrInfo.Name = "ITEMID";



attrInfo.Name = "item_id" ;


"item_id" is the property internal name format defined in Teamcenter.

Re: GetItemAndRelatedObjects c#

Sorry for my lateness !
thanx for your reply , but I had also no luck.
same error,
I think have to search for more details, maybe on the java side
for better descriptions

Re: GetItemAndRelatedObjects c#

Hello Wilmos,


I will just try to hit the nail in the darkness.  Please, check into the site preferences that 'TYPE_DISPLAY_RULES_list_types_of_subclasses' includes 'Item' into its list of values. If not, add it to the list and try your code again. Maybe it helps. 



Ramon Talavera     

Re: GetItemAndRelatedObjects c#

Siemens Phenom Siemens Phenom
Siemens Phenom


Had one more look at my Java code. First I got the same error than you. After setting it up one more time I was able to get the information.


    	m_dmService = DataManagementService.getService( AppXSession.getConnection() ); 
    	String itemId = "000794";
    	String revId = "A";
    	AttrInfo[] attrInfo = new AttrInfo[1];
    	attrInfo[0] = new AttrInfo();
    	attrInfo[0].name = "item_id";
    	attrInfo[0].value = itemId;
    	ItemInfo itemInfo = new ItemInfo();
    	itemInfo.ids = attrInfo;
    	itemInfo.clientId = "itemInfo1";
    	itemInfo.useIdFirst = true;
    	RevInfo revInfo = new RevInfo(); = revId;
    	revInfo.nRevs = 1;
    	revInfo.clientId = "revInfo1";
    	revInfo.useIdFirst = true;
    	revInfo.processing = "Ids";
    	DatasetInfo dsInfo = new DatasetInfo();
    	dsInfo.clientId = "dsInfo1";
    	dsInfo.filter = new DatasetFilter();
    	dsInfo.filter.processing = "None";
		GetItemAndRelatedObjectsInfo[] itemAndRelObjInfo = new GetItemAndRelatedObjectsInfo[1];
		itemAndRelObjInfo[0] = new GetItemAndRelatedObjectsInfo();
		itemAndRelObjInfo[0].itemInfo = itemInfo;
		itemAndRelObjInfo[0].revInfo = revInfo;
		itemAndRelObjInfo[0].datasetInfo = dsInfo;
		itemAndRelObjInfo[0].clientId = "itemAndRelObj1";
//		NamedReferenceList namedRef = new NamedReferenceList();
//		namedRef.namedReference = "TEXT";
//		namedRef.ticket = true;
		GetItemAndRelatedObjectsResponse resp = m_dmService.getItemAndRelatedObjects(itemAndRelObjInfo);