Creating an Entity using Identity Service

3 views
Skip to first unread message

Tara, Hitesh

unread,
Feb 23, 2018, 11:58:54 AM2/23/18
to kc.techni...@kuali.org

Hi All,

 

Past few days I tried to create an Entity all the way using this service. Looks like this service despite having methods to do all those does not create a Person or an individual all the way. Rice uses IdentityManagementPersonDocumentAction with the help of several services to consummate the action of creating a person. All these services are cohesive and not mutually exclusive and KEW binds them into a uniform fabric. I apologize if I sound like a carpet salesman.

 

I created This controller which receives an Entity Type in json and Expect Soap to culminate it into a full-blown Entity. But this execution results in several ojb exceptions. There is lot more to say here but trying to cut short here just in case anyone have ever encountered this action.

 

// code excerpt from controller

@PostMapping(value = "/employee/createEmployee")

       public ResponseEntity createEmployee(@RequestBody  Entity entity) throws RiceIllegalArgumentException, RiceIllegalStateException {

 

              URL wsdlURL = IdentityService_Service.WSDL_LOCATION;

              KSBCampusServiceClient client = new KSBCampusServiceClient();

              ObjectFactory factory = new ObjectFactory();

              final ObjectMapper mapper = new ObjectMapper(); // jackson's objectmapper

              final EntityType pojo = mapper.convertValue(entity, EntityType.class);

 

              CreateEntity createNewEntity = factory.createCreateEntity();         

              createNewEntity.setEntity(pojo);

              IdentityService svc = client.getCampusService(wsdlURL);

 

              CreateEntityResponse response = svc.createEntity(createNewEntity);

              return new ResponseEntity(response, HttpStatus.OK);

       }

 

 

Any suggestions will be appreciated.

 

Thanks,

Hitesh

 

 

http://localhost:8080/kc-dev/remoting/soap/kim/v2_0/identityService 

Entity type

{

 
"id": "U171196933718",
 
"principals": {
   
"principal": [
      {
       
"principalId": "U171196933718",
       
"principalName": "mukadd3er",
       
"active": true,
       
"any": []
      }
    ]
  },

 
"externalIdentifiers": {
   
"externalIdentifier": []
  },

 
"names": {
   
"name": [
      {
       
"id": "48559",
       
"entityId": "U171196933718",
       
"nameType": {
         
"code": "PRFR",
         
"name": "Preferred",
         
"sortCode": "b",
         
"active": true,
         
"versionNumber": 1,
         
"objectId": "5B97C50B03866110E0404F8189D85213",
         
"any": []
        },
       
"namePrefix": null,
       
"nameTitle": null,
       
"firstName": "HITESH",
       
"middleName": null,
       
"lastName": "TARA",
       
"nameSuffix": null,
       
"compositeName": "xxxxx",
       
"namePrefixUnmasked": null,
       
"nameTitleUnmasked": null,
       
"firstNameUnmasked": "xxxxxx",
       
"middleNameUnmasked": null,
       
"lastNameUnmasked": "xxxxxx",
       
"nameSuffixUnmasked": null,
        
"compositeNameUnmasked": "",
       
"noteMessage": null,
       
"nameChangedDate": null,
       
"suppressName": false,
       
"defaultValue": true,
       
"active": true,
       
"versionNumber": 21,
       
"objectId": "b6e25e31-2f97-47df-858f-dd8b2619c93f",
       
"any": []
      }
    ]
  },
 
"employmentInformation": {
   
"employment": [
      {
       
"id": "56843",
       
"entityId": "U171196933718",
       
"employeeId": "U171196933718",
       
"employmentRecordId": "2",
       
"entityAffiliation": {
         
"id": "47537",
         
"entityId": "U171196933718",
         
"affiliationType": {
           
"code": "0002",
           
"name": "NREP-Staff",
           
"sortCode": null,
           
"active": true,
           
"employmentAffiliationType": false,
           
"versionNumber": 1,
           
"objectId": "A67AFBBB360068C3E04005950AF118A5",
           
"any": []
          },
         
"campusCode": "10",
         
"defaultValue": true,
         
"active": true,
         
"versionNumber": 21,
         
"objectId": "74142e32-a432-48af-8245-f0f2e756775e",
         
"any": []
        },
       
"employeeStatus": {
         
"code": "3",
         
"name": "Active",
         
"sortCode": null,
          
"active": true,
         
"versionNumber": 1,
         
"objectId": "A67AFC7A40D37810E04005950AF118BC",
         
"any": []
        },
       
"employeeType": {
         
"code": "6",
         
"name": "Staff-Exempt FT",
         
"sortCode": null,
          
"active": true,
         
"versionNumber": 1,
         
"objectId": "A67AFC9C1E046ED4E04005950AF118D4",
         
"any": []
        },
       
"primaryDepartmentCode": "1510500000",
       
"baseSalaryAmount": "0.00",
       
"primary": true,
       
"versionNumber": 21,
       
"objectId": "c0893f64-3c29-4ef6-ab02-c6ba7af3b23b",
       
"active": true,
       
"any": []
      }
    ]
  },
 
"primaryEmployment": {
   
"id": "56843",
   
"entityId": "U171196933718",
   
"employeeId": "U171196933718",
    
"employmentRecordId": "2",
   
"entityAffiliation": {
     
"id": "47537",
     
"entityId": "U171196933718",
     
"affiliationType": {
       
"code": "0002",
       
"name": "NREP-Staff",
       
"sortCode": null,
       
"active": true,
       
"employmentAffiliationType": false,
       
"versionNumber": 1,
       
"objectId": "A67AFBBB360068C3E04005950AF118A5",
       
"any": []
      },
     
"campusCode": "10",
     
"defaultValue": true,
     
"active": true,
     
"versionNumber": 21,
     
"objectId": "74142e32-a432-48af-8245-f0f2e756775e",
     
"any": []
    },
   
"employeeStatus": {
     
"code": "3",
     
"name": "Active",
     
"sortCode": null,
     
"active": true,
     
"versionNumber": 1,
     
"objectId": "A67AFC7A40D37810E04005950AF118BC",
     
"any": []
    },
   
"employeeType": {
     
"code": "6",
     
"name": "Staff-Exempt FT",
     
"sortCode": null,
     
"active": true,
     
"versionNumber": 1,
     
"objectId": "A67AFC9C1E046ED4E04005950AF118D4",
     
"any": []
    },
   
"primaryDepartmentCode": "1510500000",
   
"baseSalaryAmount": "0.00",
   
"primary": true,
   
"versionNumber": 21,
   
"objectId": "c0893f64-3c29-4ef6-ab02-c6ba7af3b23b",
   
"active": true,
   
"any": []
  },
 
"defaultAffiliation": {
   
"id": "47537",
   
"entityId": "U171196933718",
   
"affiliationType": {
     
"code": "0002",
     
"name": "NREP-Staff",
     
"sortCode": null,
     
"active": true,
     
"employmentAffiliationType": false,
     
"versionNumber": 1,
     
"objectId": "A67AFBBB360068C3E04005950AF118A5",
     
"any": []
    },
   
"campusCode": "10",
   
"defaultValue": true,
   
"active": true,
   
"versionNumber": 21,
   
"objectId": "74142e32-a432-48af-8245-f0f2e756775e",
   
"any": []
  },
 
"active": true,
 
"any": []

}

 

 

Reply all
Reply to author
Forward
0 new messages