.equals(XMLConfigConstants.PROXY_ELT.getLocalPart())) {
String proxyName = proxyServiceElement.getAttributeValue(new QName("name"));
SynapseConfiguration synapseConfig = getSynapseConfiguration();
ProxyService currentProxy = synapseConfig.getProxyService(proxyName);
boolean wasRunning;
if (currentProxy == null) {
handleException(log, "A proxy service named "
+ proxyName + " does not exist", null);
} else {
wasRunning = currentProxy.isRunning();
log.debug("Deleting existing proxy service : " + proxyName);
AxisService axisService = synapseConfig.getAxisConfiguration().
getService(proxyName);
if (axisService != null) {
axisService.getParent().addParameter(
CarbonConstants.KEEP_SERVICE_HISTORY_PARAM, "true");
updateAndSyncServiceParameters(currentProxy,axisService);
}
deleteProxyService(proxyName);
try {
log.debug("Adding proxy service : " + proxyName);
addProxyService(proxyServiceElement, currentProxy.getFileName(), true);
if(log.isDebugEnabled()) {
log.debug("Modified proxy service : " + proxyName);
}
if (!wasRunning &&
synapseConfig.getProxyService(proxyName).isRunning()) {
synapseConfig.getProxyService(proxyName).stop(synapseConfig);
} else if (wasRunning &&
!synapseConfig.getProxyService(proxyName).isRunning()) {
synapseConfig.getProxyService(proxyName).start(synapseConfig);
}
ProxyService proxy = synapseConfig.getProxyService(proxyName);
if (proxy != null) {
if (proxy.getTargetInLineInSequence() != null) {
proxy.getTargetInLineInSequence().init(getSynapseEnvironment());
}
if (proxy.getTargetInLineOutSequence() != null) {
proxy.getTargetInLineOutSequence().init(getSynapseEnvironment());
}
if (proxy.getTargetInLineFaultSequence() != null) {
proxy.getTargetInLineFaultSequence().init(getSynapseEnvironment());
}
if (proxy.getTargetInLineEndpoint() != null) {
proxy.getTargetInLineEndpoint().init(getSynapseEnvironment());
}
}
} catch (Exception e) {
log.error("Unable to save changes made for the proxy service : "