}
@SuppressWarnings("unchecked")
private ActivityBean parseActivity(SOAPEnvelope respEnvelope) {
ActivityBean ab = new ActivityBean();
OMElement activityRegistryObjectsElement = respEnvelope.getBody().getFirstElement();
// System.out.println("activity: rif-cs: " + activityRegistryObjectsElement);
OMElement registryObject = activityRegistryObjectsElement.getFirstElement();
// get the party group
OMAttribute groupAtt = registryObject.getAttribute(new QName("group"));
ab.setGroupName(groupAtt.getAttributeValue());
// set the party key
Iterator<OMElement> keyit = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "key"));
if (keyit.hasNext()) {
OMElement keyElement = keyit.next();
String key = keyElement.getText();
ab.setActivityKey(key);
}
// originating source
Iterator<OMElement> origit = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "originatingSource"));
if (origit.hasNext()) {
OMElement orig = origit.next();
OMAttribute typeAtt = orig.getAttribute(new QName("type"));
String origvalue = orig.getText();
// set originating source type
ab.setOriginateSourceType(typeAtt.getAttributeValue());
// set originating source type value
ab.setOriginateSourceValue(origvalue);
}
// originating source
Iterator<OMElement> activityIt = registryObject.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "activity"));
if (activityIt.hasNext()) {
OMElement activityElement = activityIt.next();
// identifier
Iterator<OMElement> identifierIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "identifier"));
if (identifierIt.hasNext()) {
OMElement identifierEle = identifierIt.next();
OMAttribute typeAtt = identifierEle.getAttribute(new QName("type"));
// set the identifier
ab.setIdentifierType(typeAtt.getAttributeValue());
ab.setIdentifierValue(identifierEle.getText());
}
// activity name and name part
Iterator<OMElement> pNameIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "name"));
if (pNameIt.hasNext()) {
OMElement pNameElement = pNameIt.next();
Iterator<OMElement> pNamePartIt = pNameElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "namePart"));
if (pNamePartIt.hasNext()) {
OMElement pnamePartElement = pNamePartIt.next();
// set the name part value - title
ab.setNamePartValue(pnamePartElement.getText());
}
}
// desc
Iterator<OMElement> descIt = activityElement.getChildrenWithName(new QName(DEFAULT_RESPONSE_NAMESPACE, "description"));
if (descIt.hasNext()) {
OMElement descElement = descIt.next();
OMAttribute typeAtt = descElement.getAttribute(new QName("type"));
// set the desc type
ab.setDescType(typeAtt.getAttributeValue());
// set the desc
ab.setDescValue(descElement.getText());
}
}
ab.setRifcsContent(normalizerifcs(registryObject.toString()));
// System.out.println("activity rifcs content: " + ab.getRifcsContent());
return ab;
}