logger.debug("Trying to fetch applicationProfile profile from the infrastructure for "+APPLICATION_PROFILE_NAME+" scope: "+rootScopeForInfrastructure);
try{
Queryq=newQueryBox("for $profile in collection('/db/Profiles/GenericResource')//Resource "+
"where $profile/Profile/SecondaryType/string() eq 'ApplicationProfile' and $profile/Profile/Name/string() "+
" eq '"+APPLICATION_PROFILE_NAME+"'"+
"return $profile");
DiscoveryClient<String>client=client();
List<String>appProfile=client.submit(q);
if(appProfile==null||appProfile.size()==0)
thrownewApplicationProfileNotFoundException("Your applicationProfile is not registered in the infrastructure");
logger.debug("Scope is missing for url "+url+". Returning "+scope);
scopeToReturn=scope;
}
}
else
throw
newApplicationProfileNotFoundException("Your applicationProfile EndPoint was not found in the profile, consider adding <EndPoint><Scope> element in <Body>");
}
}catch(Exceptione){
logger.error("Error while trying to fetch applicationProfile profile from the infrastructure",e);