if (!TARGET_Q.equals(elem.getQName())) {
handleException("Element does not match with the target QName");
}
Target target = new Target();
OMAttribute toAttr = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "to"));
if (toAttr != null && toAttr.getAttributeValue() != null) {
target.setToAddress(toAttr.getAttributeValue());
}
OMAttribute soapAction = elem.getAttribute(
new QName(XMLConfigConstants.NULL_NAMESPACE, "soapAction"));
if (soapAction != null && soapAction.getAttributeValue() != null) {
target.setSoapAction(soapAction.getAttributeValue());
}
OMAttribute sequenceAttr = elem.getAttribute(
new QName(XMLConfigConstants.NULL_NAMESPACE, "sequence"));
if (sequenceAttr != null && sequenceAttr.getAttributeValue() != null) {
target.setSequenceRef(sequenceAttr.getAttributeValue());
}
OMAttribute endpointAttr = elem.getAttribute(
new QName(XMLConfigConstants.NULL_NAMESPACE, "endpoint"));
if (endpointAttr != null && endpointAttr.getAttributeValue() != null) {
target.setEndpointRef(endpointAttr.getAttributeValue());
}
OMElement sequence = elem.getFirstChildWithName(
new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "sequence"));
if (sequence != null) {
SequenceMediatorFactory fac = new SequenceMediatorFactory();
target.setSequence(fac.createAnonymousSequence(sequence, properties));
}
OMElement endpoint = elem.getFirstChildWithName(
new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint"));
if (endpoint != null) {
target.setEndpoint(EndpointFactory.getEndpointFromElement(endpoint, true, properties));
}
return target;
}