Skip to content

Commit

Permalink
Improve fix made in PR#1139
Browse files Browse the repository at this point in the history
  • Loading branch information
Isuru Loku Narangoda authored and Isuru Loku Narangoda committed Aug 1, 2018
1 parent d0e8c71 commit dacb548
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,19 +668,21 @@ public AxisService buildAxisService(SynapseConfiguration synCfg, AxisConfigurati

for (PolicyInfo pi : policies) {

String key = pi.getPolicyKey();
String policyKey = pi.getPolicyKey();
Policy policy = null;

synCfg.getEntryDefinition(key);
Object o = synCfg.getEntry(key);
if (o == null) {
handleException("NoSecurity Policy found from key " + key + " in Axis2 service \"" + name + "\"");
synCfg.getEntryDefinition(policyKey);
Object policyEntry = synCfg.getEntry(policyKey);
if (policyEntry == null) {
handleException("Security Policy Entry not found for key: " + policyKey +
" in Proxy Service: " + name);
} else {
policy = PolicyEngine.getPolicy(SynapseConfigUtils.getStreamSource(o).getInputStream());
policy = PolicyEngine.getPolicy(SynapseConfigUtils.getStreamSource(policyEntry).getInputStream());
}

if (policy == null) {
handleException("Cannot find Policy from the key");
handleException("Invalid Security Policy found for the key: " + policyKey +
" in proxy service: " + name);
}

if (NO_SECURITY_POLICY.equals(policy.getId())) {
Expand Down

0 comments on commit dacb548

Please sign in to comment.