我们为StockItem屏幕创建了三个自定义字段(参见附图)。
我们希望使用其中一个CustomField通过Web服务端点(WSE)5.30.001进行搜索,为此,我们在WSE定义Oz WSE Definition中创建了一个新的OzStockItem元素,并试图通过以下代码。
var itemList = c.GetList(new OzStockItem { OzMinCount = new IntSearch { Condition = IntCondition.IsGreaterThan, Value = 0 } }, false).Cast<OzStockItem>();
但是,不是返回与过滤器匹配的项目列表,而是失败,并出现以下错误。
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll
Additional information:
System.Web.Services.Protocols.SoapException: Server was unable to process request.
---> System.InvalidCastException: Specified cast is not valid.
at PX.Api.ContractBased.ExportTableToEntitiesMapper.<MapCustomFields>d__28.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at PX.Api.ContractBased.ExportTableToEntitiesMapper.<MapEntitiesInner>d__26.MoveNext()
at PX.Api.ContractBased.ExportTableToEntitiesMapper.<MapEntities>d__25.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at PX.Api.ContractBased.EntityService.GetList(EntityGateBase gate, String version, String name, EntityImpl entity, Boolean returnFullEntities, Boolean ignoreValueFields, PXGraph graph)
at PX.Api.ContractBased.Soap.EntityGate.GetList(Entity entity, Boolean returnFullEntities)
有人可以告诉我们这里缺少什么吗?