String webServiceName = (String)webServiceEndpointKey;
boolean published = false;
try{
RegistryAccessObject rao = this.getRegistryAccessObject();
_logger.fine("WebServiceMgrBackEnd.publishToRegistry: publishing" +
"WebService "+webServiceName);
String lbhost = (String)optional.get(WebServiceMgr.LB_HOST_KEY);
if (lbhost == null){
lbhost = getHostAddress();
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer Host is unspecified setting to "+ lbhost);
}
String wsdl = getWSDL (lbhost, webServiceName);
if(wsdl == null){
_logger.log(Level.SEVERE,
"registry.wsdl_absent_publish_failure",
webServiceName);
throw new RuntimeException (" Could not retreive WSDL for "+
webServiceName);
}
String lbport = (String)optional.get(WebServiceMgr.LB_PORT_KEY);
String lbsslport = (String)optional.get(WebServiceMgr.LB_SECURE_PORT);
if (lbport == null && lbsslport == null) {
lbport = getPort(webServiceName, true, wsdl);
if (lbport == null)
lbport = MINUS_ONE;
lbsslport = getPort(webServiceName, false, wsdl);
if (lbsslport == null)
lbsslport = MINUS_ONE;
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer Port Unspecified setting to default values " +
"LoadBalancer Port = "+ lbport +
" LoadBalancer SSL Port = "+lbsslport);
} else if (lbsslport == null){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer SSL Port is unspecified setting to "+ MINUS_ONE);
lbsslport = MINUS_ONE;
} else if (lbport == null){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer Host is unspecified setting to "+ MINUS_ONE);
lbport = MINUS_ONE;
}
int ilbport = -1;
int ilbsslport = -1;
try{
ilbport = Integer.valueOf(lbport);
} catch (NumberFormatException e){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer Port is not a number. Setting to "+ MINUS_ONE);
ilbport = -1;
}
try{
if(lbsslport !=null)
ilbsslport = Integer.valueOf(lbsslport);
}catch (NumberFormatException e){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Load " +
"Balancer SSL Port is not a number. Setting to "+ MINUS_ONE);
ilbsslport = -1;
}
String categoriesList = (String)optional.get(WebServiceMgr.CATEGORIES_KEY);
String[] categories = null;
if (categoriesList != null){
java.util.StringTokenizer tokenizer =
new java.util.StringTokenizer(categoriesList, ",");
List<String> list = new ArrayList<String>();
while (tokenizer.hasMoreElements()){
list.add((String)tokenizer.nextToken());
}
categories = new String[list.size()];
categories = list.toArray(categories);
}
String organization = (String) optional.get(WebServiceMgr.ORGANIZATION_KEY);
if (organization == null){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Organization " +
" unspecified. Setting a default organization "+
DEFAULT_ORGANIZATION);
organization = DEFAULT_ORGANIZATION;
}
String description = (String) optional.get(WebServiceMgr.DESCRIPTION_KEY);
if (description == null){
_logger.fine("WebServiceMgrBackend.publishToRegistry: Web Service " +
" Description unspecified. Setting a default description: "+
DEFAULT_DESCRIPTION);
description = DEFAULT_DESCRIPTION;
}
published = rao.publish(registryLocations, webServiceName, lbhost,
ilbport, ilbsslport, categories, organization, description,
wsdl);
if (published == false){
String errorMessage =
_stringMgr.getString("WebServiceMgrBackend.PublishFailure",