Answered

Inserting new records in collection using SOAP

Hello!

First of all, to give a bit of context, I have two master entities in my project, Narrative and Policy and the relationship between them is one to many (one Narrative has a collection of Policies, thus the Policy table has a field called "Narrative" which was added when creating the relationship).

What I would like to do is insert a couple of Policies for an exists case (Narrative) by using the SaveEntity method of EntityManagerSOA.

I managed to get right the synthax for updating the Narrative, for example, by using the command below.

<BizAgiWSParam>

<Entities>

<App idCase = "251">

<Narrative><ClaimRefNo>test</ClaimRefNo></Narrative></App>

</Entities>

</BizAgiWSParam>

But when I change that to what I want to do,which is inserting a new policy...

<BizAgiWSParam>

<Entities>

<App idCase = "251">

<Policy><PolicyRefNo>test</PolicyRefNo></Policy></App>

</Entities>

</BizAgiWSParam>

I get the following error message from SOAP: Error saving XML: XPath = Policy. Relation not found.

The relationship is configured correctly, because for example, as a test, I created a temporary form with a table based on the Policy entity and I managed to insert rows into it for a case (a Narrative).

I also attached a screenshot of the Data Model.

Do you have any ideas what I am doing wrong or what did I miss during config?

Thank you in advance!

Comments (2)

photo
1

In the meantime I found the correct synthax.

<BizAgiWSParam>

<Entities>

<App idCase = "251">

<Narrative>

<Policies>

<Policy><PolicyRefNo>test1</PolicyRefNo></Policy>

<Policy><PolicyRefNo>test2</PolicyRefNo></Policy>

<Policy><PolicyRefNo>test3</PolicyRefNo></Policy>

</Policies>

</Narrative>

</App>

</Entities>

</BizAgiWSParam>

photo
1

Dear Andreea,

In this case, the XML is not correct because the attribute 'idCase' must be inside the tag 'Entities'. We share with you the example placed in our documentation for this purpose:

<BizAgiWSParam>

<Entities idCase="1">

<Vacations>

<VacationRequest>

<Applicant>

<IdentificationNumber>159753</IdentificationNumber>

</Applicant>

</VacationRequest>

</Vacations>

</Entities>

</BizAgiWSParam>

We hope this information works for you!

Kind regards.