log.debug("Configuring service " + axisService.getName() + " using: " + service_file);
}
try {
if (configCtx == null)
configCtx = new ConfigurationContext(axisService.getAxisConfiguration());
ServiceBuilder builder = new ServiceBuilder(configCtx, axisService);
StAXOMBuilder omBuilder = new StAXOMBuilder(serviceDescIs);
OMElement documentEle = omBuilder.getDocumentElement();
Iterator itr = documentEle.getChildElements();
while (itr.hasNext()) {
OMElement serviceEle = (OMElement) itr.next();
if (serviceEle.getLocalName().toLowerCase().equals("service")) {
if (serviceEle.getAttribute(new QName("name")) != null &&
serviceEle.getAttribute(new QName("name")).getAttributeValue().equals(axisService.getName())) {
builder.populateService(serviceEle);
// This is a hack to avoid security configurations get persisted when we configure using
// services.xml file or policy.xml file BPEL package. But this should be fix at the
// Carbon Persistence manager.
Parameter param = new Parameter(CONFIGURED_USING_BPEL_PKG_CONFIG_FILES, "true");
axisService.addParameter(param);
} else if (serviceEle.getAttribute(new QName("name")) != null && // Starts with check is used to handle anonymous services generated for external service.
axisService.getName().startsWith("axis_service_for_" + serviceEle.getAttributeValue(new QName("name")))) {
String svcName = axisService.getName();
AxisService axisSvc = builder.populateService(serviceEle);
axisSvc.setName(svcName);
}
}
}