public static void defineEndpoint(SynapseConfiguration config, OMElement ele) {
OMAttribute name = ele.getAttribute(new QName(Constants.NULL_NAMESPACE, "name"));
OMAttribute key = ele.getAttribute(new QName(Constants.NULL_NAMESPACE, "key"));
if (name != null && key != null) {
Property dp = new Property();
dp.setType(Property.DYNAMIC_TYPE);
dp.setKey(key.getAttributeValue());
dp.setMapper(EndpointFactory.getInstance());
config.addNamedEndpoint(name.getAttributeValue(), dp);
} else {
Endpoint endpoint = EndpointFactory.createEndpoint(ele, false);
// add this endpoint to the configuration
config.addNamedEndpoint(endpoint.getName(), endpoint);