处理实体时出错设备无法创建实体对象

时间:2014-03-21 14:56:37

标签: c# assets infor-eam

我正在尝试使用infor-eam工具包中的AddGISAsset:

  

MP0385_AddGISAsset_001

我收到此错误:

  

处理实体设备无法创建实体对象时出错。

以下是代码:

public string addGisAsset()
        {

            MP0385_AddGISAsset_001.AddGISAssetService getservice = new MP0385_AddGISAsset_001.AddGISAssetService();
            MP0385_AddGISAsset_001.MP0385_AddGISAsset_001 getrequest = new MP0385_AddGISAsset_001.MP0385_AddGISAsset_001();
            MP0385_AddGISAsset_001.MP0385_AddGISAsset_001_Result getresult = new MP0385_AddGISAsset_001.MP0385_AddGISAsset_001_Result();

            string desc = null;
            MP0385_AddGISAsset_001.EQUIPMENTID_Type asset = new MP0385_AddGISAsset_001.EQUIPMENTID_Type();
            asset.EQUIPMENTCODE = "2000000";
            asset.ORGANIZATIONID = new MP0385_AddGISAsset_001.ORGANIZATIONID_Type();
            asset.ORGANIZATIONID.ORGANIZATIONCODE = _orgcode;
            MP0385_AddGISAsset_001.QUANTITY X = new MP0385_AddGISAsset_001.QUANTITY();
            MP0385_AddGISAsset_001.QUANTITY Y = new MP0385_AddGISAsset_001.QUANTITY();
            X.VALUE = 50;
            X.NUMOFDEC = "2";
            X.SIGN = "+";
            X.UOM = "feet";
            Y.VALUE = 75;
            Y.NUMOFDEC = "2";
            Y.SIGN = "+";
            Y.UOM = "feet";

            getrequest.GISAsset = new MP0385_AddGISAsset_001.GISAsset();
            getrequest.GISAsset.ASSETID = asset;
            getrequest.GISAsset.XLOCATION = X;
            getrequest.GISAsset.YLOCATION = Y;
            getrequest.GISAsset.GISLAYER = "0";

            Datastream.EWS.Session sess = new Datastream.EWS.Session(_userid, _passwd, "*", _url, _tenant, false);

            // Start Request
            sess.PrepareServiceRequest(getservice);

            // Call Web Service and get result
            getresult = getservice.AddGISAssetOp(getrequest);

            // Extract Description (just for testing, we dont need this)
            desc = getresult.ResultData.GISAsset.ASSETID.EQUIPMENTCODE;

            // Close Up/Dispose
            sess.CompleteServiceRequest(getservice);
            sess.Dispose();
            return desc;

        }

PLEASE:有人可以为stackoverflow.com创建一个名为" INFOR-EAM"

的新标签

这是产品:

http://www.infor.com/solutions/eam/

1 个答案:

答案 0 :(得分:0)

解决,结果是错误意味着设备代码不存在:

asset.EQUIPMENTCODE =“2000000”;

非常误导性的错误消息,但能够解决它。