OMElement epElement = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "endpoint"));
if (epElement != null) {
// get the factory for the element
// create the endpoint and set it in the send medaitor
EndpointFactory fac = EndpointAbstractFactory.getEndpointFactroy(epElement);
if (fac != null) {
Endpoint endpoint = fac.createEndpoint(epElement, true);
if (endpoint != null) {
sm.setEndpoint(endpoint);
}
} else {
throw new SynapseException("Invalid endpoint fromat.");