I'm running a census load through web services to create a member contract including voluntary spouse coverage. The employee and employee coverage are created succesfully, but when the spouse person object is being created, the correspondence fails to get appended to the correspondence list.
eWam 6.0.0.36 wInterface 4.1.24.0
Method: CreateListOfActorCorrespondences
forEach curActorCorrespondence in ListOfCreatedCorrespondences using rank
**thisActor.Correspondences.AppendObject(curActorCorrespondence)**
if rank = DefaultCorrespondenceRank
curActorCorrespondence.SetAsDefault
endIf
endFor
The same method is called to create the employee, but when creating the spouse the curActorCorrespondence
which is successfully created isn't appended to thisActor.Correspondences
. What could be causing the difference in behavior in this code?
Start by searching the WSM error trace. In this case the following error was found:
14/01/16 15:48:12 Process Id 4176 Thread Id 6440 Thread Index 1 Minor error WLISTOF.CPP
aListReftosType.ListInsert is refused by the role: aWFCorrespondenceVersionedByDate Add =0000:0000:2380:2F00 NSId = 0 Id = 0 Version = 2147483647 Current Gold method:SLI_Actor._CreateListOfActorCorrespondences #3
The issue is then clear, as aXXX_CorrespondenceVersionedByDate
child class of aWFCorrespondenceVersionedByDate
existed, but was not being created for the spouse. Further review of the class structure showed the class aSPLI_CreateOrUpdatePerson_In
didn’t have any children classes so it couldn’t be a missing overriding/ child class causing the incorrect object to be created.
Debug fillvarfromparam
and Deserialize
methods in classes generated by wInterface
to finally find the issue with inconsistencies in the XML structure.
In this case: Under employee tag:
<Correspondences xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:aXXX_Correspondance">
Under enrollment tag(where the failure was happening):
<Correspondences xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:aXXX_Correspondance">
<Element xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Moving the xsi:type attribute
to the correct tag fixed the issue, allowing the correct correspondence list to be created and appended.