String serviceAlias = xService.getAttributeValueByName("name");
String serviceName = xService.getAttributeValueByName("service");
XmlElement authentication = xService.getElementByName("authentication-server");
XmlElement xServiceDefinition = XappDB.findElement("xpath.model:xapp-server/services/node()[@name=\""+serviceName+"\"]");
HttpRouter service = buildService( server,name,xServiceDefinition );
if(authentication!=null)
{
String address = authentication.getAttributeValueByName("address");
int port = Integer.parseInt(authentication.getAttributeValueByName("port"));
String domain = authentication.getAttributeValueByName("domain");
String subDomain = authentication.getAttributeValueByName("subdomain");
try{
HttpAuthenticator authenticator = new HttpAuthenticator(server.getFileServer(),address,port,domain,subDomain);
service.setAuthenticator(authenticator);
}
catch(Exception e)
{
XappRootApplication.displayException(e);
XappRootApplication.displayMessage("Server "+name+" not built as HttpAuthenticator failed");