Discussions
REST API Error: ArgumentFault: Incorrect number of identity element
Hello, I am trying to perform a GET request for one of my tables and receive this error: ArgumentFault: Incorrect number of identity element
GET URL: {{imisURL}}/Asi.Scheduler_iMIS_TEST/api/SUBSPECIALTY/000002
If I don't identify a specific ID to return the GET request will go through with a response like this:
{
"$type": "Asi.Soa.Core.DataContracts.PagedResult1[[Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts]], Asi.Contracts", "Items": { "$type": "System.Collections.Generic.List
1[[Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts]], mscorlib",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts",
"EntityTypeName": "SUBSPECIALTY",
"PrimaryParentEntityTypeName": "Party",
"Identity": {
"$type": "Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts",
"EntityTypeName": "SUBSPECIALTY",
"IdentityElements": {
"$type": "System.Collections.ObjectModel.Collection1[[System.String, mscorlib]], mscorlib", "$values": [ "000002", "127290" ] } }, "PrimaryParentIdentity": { "$type": "Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts", "EntityTypeName": "Party", "IdentityElements": { "$type": "System.Collections.ObjectModel.Collection
1[[System.String, mscorlib]], mscorlib",
"$values": [
"000002"
]
}
},
"Properties": {
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "PartyId",
"Value": "000002"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SEQN",
"Value": {
"$type": "System.Int32",
"$value": 127290
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUBSPECIALTY_NAME",
"Value": "General"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUBSPECIALTY_OTHER"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUBSPECIALTY_TYPE",
"Value": "PRIMARY"
}
]
}
},
}
The data structure in SQL is attached as an image. How do I perform a REST GET request for a specific record in this table?
Here's the full error response:
ArgumentFault: Incorrect number of identity elements: at Asi.Services.Core.EntityServiceToCommonServiceAdapter1.FindById(Object id) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Service\Core\Asi.Services.Core\Core\EntityServiceToCommonServiceAdapter.cs:line 330 at Asi.Services.Core.EntityServiceToCommonServiceAdapter
1.Asi.Soa.Core.ServiceContracts.ICommonService.FindById(Object id) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Service\Core\Asi.Services.Core\Core\EntityServiceToCommonServiceAdapter.cs:line 224
at Castle.Proxies.Invocations.ICommonService_FindById.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Asi.Shared.Aspects.CacheAspect.Intercept(IInvocation invocation) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Platform\Asi.Shared\Aspects\CacheAspect.cs:line 62
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Asi.Services.Core.Interceptors.CommonSecurityAspect.Intercept(IInvocation invocation) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Service\Core\Asi.Services.Core\Core\Interceptors\CommonSecurityAspect.cs:line 61
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Asi.Shared.Aspects.PerformanceAspect.Intercept(IInvocation invocation) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Platform\Asi.Shared\Aspects\PerformanceAspect.cs:line 55
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ICommonService`1Proxy_2.FindById(Object id)
at Asi.Scheduler.Controllers.CommonServiceController.Get(String entityName, String entityId) in C:\Builds\208\ScrumV3\sp137_Main10\Sources\MainFoundation\imis.net\Packages\Service\Asi.Scheduler.Common\Controllers\CommonServiceController.cs:line 165
Start typing markdown or type / to insert a block