RelationshipParticipantType relationshipParticipantType = relationshipType.addNewParticipant();
relationshipParticipantType.setResourceId("urn:" + InteropConstants.WEATHERSTATION_KEY1);
relationshipParticipantType.setRole("urn://parent");//uri
EndpointReferenceType manageabilityEndpointReferenceType = relationshipParticipantType.addNewManageabilityEndpointReference();
manageabilityEndpointReferenceType.addNewAddress().setStringValue(InteropConstants.SERVICES_URL + "/" + InteropConstants.WEATHERSTATION_SERVICE_NAME);
ReferencePropertiesType referencePropertiesType = manageabilityEndpointReferenceType.addNewReferenceProperties();
XmlObject key1 = XmlBeanUtils.addChildElement(referencePropertiesType, qName);
XmlBeanUtils.setValue(key1, InteropConstants.WEATHERSTATION_KEY1);
RelationshipParticipantType relationshipParticipantType2 = relationshipType.addNewParticipant();
relationshipParticipantType2.setResourceId("urn:" + InteropConstants.WEATHERSTATION_KEY2);//spec optional
relationshipParticipantType2.setRole("urn://child1");//uri
EndpointReferenceType manageabilityEndpointReferenceType2 = relationshipParticipantType.addNewManageabilityEndpointReference();
manageabilityEndpointReferenceType2.addNewAddress().setStringValue(InteropConstants.SERVICES_URL + "/" + InteropConstants.WEATHERSTATION_SERVICE_NAME);
ReferencePropertiesType referencePropertiesType2 = manageabilityEndpointReferenceType2.addNewReferenceProperties();
XmlObject key2 = XmlBeanUtils.addChildElement(referencePropertiesType2, qName);
XmlBeanUtils.setValue(key2, InteropConstants.WEATHERSTATION_KEY2);
resourceProperty.add(relationshipDocument);