return PrivilegedCarbonContext.getCurrentContext(messageContext).getTenantDomain();
}
private int getTenantId(MessageContext messageContext) {
//Ideally this should take from thread local carbon context change this temporary
PrivilegedCarbonContext carbonContext =
PrivilegedCarbonContext.getCurrentContext(messageContext);
int tenantId = carbonContext.getTenantId();
if (tenantId > -1 || tenantId == MultitenantConstants.SUPER_TENANT_ID) {
return tenantId;
}
String domain = carbonContext.getTenantDomain();
if (domain == null) {
SOAPBody soapBody = messageContext.getEnvelope().getBody();
if (soapBody != null && soapBody.getFirstElement() != null) {
OMElement usernameElem = soapBody.getFirstElement().getFirstChildWithName(
new QName(ServerConstants.AUTHENTICATION_SERVICE_NS,