OMElement targetElt = elem.getFirstChildWithName(Q_TARGET);
if (attServiceURL != null) {
serviceURL = attServiceURL.getAttributeValue();
} else {
throw new MediatorException("The 'serviceURL' attribute is required for the Callout mediator");
}
if (attAction != null) {
action = attAction.getAttributeValue();
}
if (configElt != null) {
OMAttribute axis2xmlAttr = configElt.getAttribute(ATT_AXIS2XML);
OMAttribute repoAttr = configElt.getAttribute(ATT_REPOSITORY);
if (axis2xmlAttr != null && axis2xmlAttr.getAttributeValue() != null) {
axis2xml = axis2xmlAttr.getAttributeValue();
}
if (repoAttr != null && repoAttr.getAttributeValue() != null) {
clientRepository = repoAttr.getAttributeValue();
}
}
if (sourceElt != null) {
if (sourceElt.getAttribute(ATT_XPATH) != null) {
try {
requestXPath = SynapseXPathFactory.getSynapseXPath(sourceElt, ATT_XPATH);
} catch (JaxenException e) {
throw new MediatorException("Invalid source XPath : "
+ sourceElt.getAttributeValue(ATT_XPATH));
}
} else if (sourceElt.getAttribute(ATT_KEY) != null) {
requestKey = sourceElt.getAttributeValue(ATT_KEY);
} else {
throw new MediatorException("A 'xpath' or 'key' attribute " +
"is required for the Callout 'source'");
}
} else {
throw new MediatorException("The message 'source' must be specified for a Callout mediator");
}
if (targetElt != null) {
if (targetElt.getAttribute(ATT_XPATH) != null) {
try {
targetXPath = SynapseXPathFactory.getSynapseXPath(targetElt, ATT_XPATH);
} catch (JaxenException e) {
throw new MediatorException("Invalid target XPath : "
+ targetElt.getAttributeValue(ATT_XPATH));
}
} else if (targetElt.getAttribute(ATT_KEY) != null) {
targetKey = targetElt.getAttributeValue(ATT_KEY);
} else {
throw new MediatorException("A 'xpath' or 'key' attribute " +
"is required for the Callout 'target'");
}
} else {
throw new MediatorException("The message 'target' must be specified for a Callout mediator");
}
}