Problem Inserting Data to Table PersonWantsOrg via REST API

Hi,

We would like to connct 1IM with our request system with REST API, in this case writing data to table PersonWantsOrg is required.

We managed to deal with authentications, now it is able to insert data to PersonWantsOrg by using Object Browser.

While we tried with REST API, we just kept getting response below:

{
    "responseStatus": {
        "message""An error occured."
    },
    "errorString""An error occured.",
    "exceptions": [
        {
            "number"2072000,
            "message""An error occured."
        }
    ]
}
And here is the body we sent:
{
    "values": {
        "UID_Org""14964D15-4DC0-4C06-88ED-75E18C1AC42A",
        "UID_PersonOrdered""bd5e4ba6-c53a-4427-81bd-97736bbcf028"
    }
}
System shows these 2 fields are required, and the GUID's are copied from table Person and ITShopOrg.
The version of 1IM is 7.1.2, 1IM's API web portal is used for testing.
Can anyone help?
Thanks!
Parents Reply Children
  • The logs of the Application Server serving the REST API are located on the Application Server itself in the install directory underneath App_Data\Logs.

  • Hi, finally the error can be located, thanks!

    Can you please help check the error message regarding to the first post?

    =======================================================================================================

    [810306] Error during execution of 'OnSaved' in logic module 'QER.Customizer.PersonWantsOrg'.
    [810023] Error during execution of statement: insert into PersonWantsOrg (DisplayOrg, DisplayOrgParent, DisplayOrgParentOfParent, DisplayPersonInserted, DisplayPersonOrdered, GenProcID, ObjectKeyOrdered, OrderDate, OrderState, UID_ITShopOrgFinal, UID_Org, UID_OrgParent, UID_OrgParentOfParent, UID_PersonInserted, UID_PersonOrdered, UID_PersonWantsOrg, ValidUntil, xdateinserted, xuserinserted, xdateupdated, xuserupdated, xobjectkey) values (N'CBIS Role: ACA', N'Application - CBIS', N'GAC-SOFINCO Account Management', N'Liang, Xiaotong', N'Liang, Xiaotong', 'ca1bbb8f-6dc6-4569-a8ab-94069cbbd279', '<Key><T>QERAssign</T><P>bdaefd6e-720d-430d-9b17-1cf892f92891</P></Key>', '2019-10-15 01:05:17.746', N'OrderProduct', '953A2928-5303-47FD-87B4-98AA95FD987B', '953A2928-5303-47FD-87B4-98AA95FD987B', '95dd6af6-2592-48b0-987c-19422a974cdd', '4b5988af-b834-47ab-b9c9-7e38100157af', '53862dab-31f1-4ffe-8629-b6336a026abd', '53862dab-31f1-4ffe-8629-b6336a026abd', '1ef57692-67a3-453c-b72c-95aaef0ed6c6', '2019-10-18 23:59:59.000', GetUTCDate(), N'liang.xiaotong.outs', GetUTCDate(), N'liang.xiaotong.outs', '<Key><T>PersonWantsOrg</T><P>1ef57692-67a3-453c-b72c-95aaef0ed6c6</P></Key>')
    [810143] Database error 50000: re-throw in Procedure QER_PITShopPersonHasObjectFill, Line 55
    [810143] Database error 50000: detected in (SRV=GSIAMDBV3001, DB=D1IM) Procedure QER_PITShopPersonHasObjectFill, Line 18
    [810143] Database error 50000: ObjectkeyAssignment has an invalid number of PK definitions.
     VI.Base.ViException: Error during execution of 'OnSaved' in logic module 'QER.Customizer.PersonWantsOrg'. ---> VI.Base.ViException: Error during execution of statement: insert into PersonWantsOrg (DisplayOrg, DisplayOrgParent, DisplayOrgParentOfParent, DisplayPersonInserted, DisplayPersonOrdered, GenProcID, ObjectKeyOrdered, OrderDate, OrderState, UID_ITShopOrgFinal, UID_Org, UID_OrgParent, UID_OrgParentOfParent, UID_PersonInserted, UID_PersonOrdered, UID_PersonWantsOrg, ValidUntil, xdateinserted, xuserinserted, xdateupdated, xuserupdated, xobjectkey) values (N'CBIS Role: ACA', N'Application - CBIS', N'GAC-SOFINCO Account Management', N'Liang, Xiaotong', N'Liang, Xiaotong', 'ca1bbb8f-6dc6-4569-a8ab-94069cbbd279', '<Key><T>QERAssign</T><P>bdaefd6e-720d-430d-9b17-1cf892f92891</P></Key>', '2019-10-15 01:05:17.746', N'OrderProduct', '953A2928-5303-47FD-87B4-98AA95FD987B', '953A2928-5303-47FD-87B4-98AA95FD987B', '95dd6af6-2592-48b0-987c-19422a974cdd', '4b5988af-b834-47ab-b9c9-7e38100157af', '53862dab-31f1-4ffe-8629-b6336a026abd', '53862dab-31f1-4ffe-8629-b6336a026abd', '1ef57692-67a3-453c-b72c-95aaef0ed6c6', '2019-10-18 23:59:59.000', GetUTCDate(), N'liang.xiaotong.outs', GetUTCDate(), N'liang.xiaotong.outs', '<Key><T>PersonWantsOrg</T><P>1ef57692-67a3-453c-b72c-95aaef0ed6c6</P></Key>') ---> VI.DB.DatabaseException: Database error 50000: re-throw in Procedure QER_PITShopPersonHasObjectFill, Line 55 ---> VI.DB.DatabaseException: Database error 50000: detected in (SRV=GSIAMDBV3001, DB=D1IM) Procedure QER_PITShopPersonHasObjectFill, Line 18 ---> VI.DB.DatabaseException: Database error 50000: ObjectkeyAssignment has an invalid number of PK definitions.
       --- End of inner exception stack trace ---
       --- End of inner exception stack trace ---
       at VI.DB.DataAccess.SafeDbCommand.<_CheckedAsync>d__40`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.SafeDbCommand.<ExecuteNonQueryAsync>d__16.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.ReadOnlyDbSession.<ExecuteAndLogAsync>d__93`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.ReadOnlyDbSession.<ExecuteAndLogAsync>d__92`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.ReadWriteDbSession.<_SqlExecuteNonQueryAsync>d__14.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.ReadWriteDbSession.<IgnoreBrokenConnectionAsync>d__42`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.DataAccess.ReadWriteDbSession.<SqlExecuteNonQueryAsync>d__13.MoveNext()
       --- End of inner exception stack trace ---
       at VI.DB.DataAccess.ReadWriteDbSession.<SqlExecuteNonQueryAsync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<_RunSingleAsync>d__33.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<_DoInsertsAsync>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<_FlushInternalAsync>d__28.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<_FlushInternalAsync>d__28.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbOperations.ClusteringDbOperationsQueue.<EnqueueAsync>d__24.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbEntitySink.<PutAsync>d__15.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.UnitOfWorkImpl.<PutAsync>d__37.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at QER.Customizer.PersonWantsOrg.<Handle_DecisionHistory>d__127.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at QER.Customizer.PersonWantsOrg.<OnSavedAsync>d__83.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.CombinedEntityLogic.<OnSavedAsync>d__13.MoveNext()
       --- End of inner exception stack trace ---
       at VI.DB.Entities.CombinedEntityLogic.<OnSavedAsync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DelayedLogicSaveEntityStrategy.<OnSavedAsync>d__7.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbEntitySink.<PutAsync>d__15.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.UnitOfWorkImpl.<PutAsync>d__37.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.EventUnitOfWork.<PutAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.PermissionsUnitOfWork.<PutAsync>d__10.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.EventUnitOfWork.<PutAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at QBM.AppServer.Api.SingleService.<Post>d__1.MoveNext()    at VI.DB.Entities.CombinedEntityLogic.<OnSavedAsync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DelayedLogicSaveEntityStrategy.<OnSavedAsync>d__7.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.DbEntitySink.<PutAsync>d__15.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.UnitOfWorkImpl.<PutAsync>d__37.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.EventUnitOfWork.<PutAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.PermissionsUnitOfWork.<PutAsync>d__10.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at VI.DB.Entities.EventUnitOfWork.<PutAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at QBM.AppServer.Api.SingleService.<Post>d__1.MoveNext()

  • You are trying to request an assignment resource (<Key><T>QERAssign</T><P>bdaefd6e-720d-430d-9b17-1cf892f92891</P></Key>) but the assignment resource seems to be misconfigured. Normally, such a request would lead to a filled ObjectkeyAssignment property in the PWO. Did you test that the same product can be requested in the Web Portal by the same person? Did it work?