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

时间:2014-04-28 13:32:44

标签: infor-eam

我收到以下错误,调用GetAssetEquipmentOp:

"处理实体WorkOrder无法创建实体对象"

时出错

以下是目前的代码:

public stringType getAssetDescription(string equipmentcode)
        {

            try
            {

                // Setup Service Objects
                MP0302_GetAssetEquipment_001.GetAssetEquipmentService getservice = new MP0302_GetAssetEquipment_001.GetAssetEquipmentService();
                MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001 getrequest = new MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001();
                MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001_Result getresult = new MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001_Result();

                // Setup Return Object
                stringType desc = new stringType();

                // Setup Service Parameters
                getrequest.ASSETID = new MP0302_GetAssetEquipment_001.EQUIPMENTID_Type();
                getrequest.ASSETID.EQUIPMENTCODE = equipmentcode;
                getrequest.ASSETID.ORGANIZATIONID = new MP0302_GetAssetEquipment_001.ORGANIZATIONID_Type();
                getrequest.ASSETID.ORGANIZATIONID.ORGANIZATIONCODE = _orgCodeBody;

                // Setup Datastream Object
                Datastream.EWS.Session sess = new Datastream.EWS.Session(_userid, _passwd, _orgCodeHead, _url, _tenant, false);

                // Prepare Service Request
                sess.PrepareServiceRequest(getservice);

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

                // Extract Description
                desc.stringValue = getresult.ResultData.AssetEquipment.ASSETID.DESCRIPTION;
                desc.errorNum = 0;

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

                // Return value
                return desc;

            }
            catch (Exception ex)
            {
                stringType errorStringType = new stringType();
                errorStringType.errorNum = 1;
                errorStringType.errorDesc = ex.Message;
                return errorStringType;
            }

        }

我检查了以下内容:

- 用户组具有包括BECONN
在内的界面权限 - 用户有"连接器"选择的选项
- 用户拥有状态授权,包括*到Q的EVNT

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

问题解决了!问题是工单号不存在。这是一个非常误导性的错误,但是一旦测试了现有的工单,它就会毫无问题地获取工单。