}
private UnifiedEndpoint buildUnifiedEndpoint(EndpointConfiguration endpointConfiguration) throws AxisFault {
UnifiedEndpointFactory uepFactory = new UnifiedEndpointFactory();
UnifiedEndpoint partnerEndpoint;
if (endpointConfiguration != null && (endpointConfiguration.getUnifiedEndPoint() != null ||
endpointConfiguration.getUnifiedEndPointReference() != null)) {
if (endpointConfiguration.getUnifiedEndPoint() != null) {
partnerEndpoint = uepFactory.createEndpoint(endpointConfiguration.getUnifiedEndPoint());
} else {
String uepConfPath = endpointConfiguration.getUnifiedEndPointReference();
if (!uepConfPath.startsWith(UnifiedEndpointConstants.VIRTUAL_GOV_REG) ||
!uepConfPath.startsWith(UnifiedEndpointConstants.VIRTUAL_CONF_REG) ||
!uepConfPath.startsWith(UnifiedEndpointConstants.VIRTUAL_REG)) {
if (uepConfPath.startsWith(UnifiedEndpointConstants.VIRTUAL_FILE)) {
uepConfPath = uepConfPath.substring(UnifiedEndpointConstants.VIRTUAL_FILE.
length());
}
if (isAbsoutePath(uepConfPath)) {
uepConfPath = UnifiedEndpointConstants.VIRTUAL_FILE + uepConfPath;
} else {
uepConfPath = getAbsolutePath(endpointConfiguration.getBasePath(), uepConfPath);
}
}
partnerEndpoint = uepFactory.createVirtualEndpoint(uepConfPath);
}
} else {
partnerEndpoint = new UnifiedEndpoint();
partnerEndpoint.setUepId(this.serviceName.getLocalPart());
partnerEndpoint.setAddressingEnabled(true);
partnerEndpoint.setAddressingVersion(UnifiedEndpointConstants.
ADDRESSING_VERSION_FINAL);
}
if (partnerEndpoint.getAddress() == null) {
partnerEndpoint.setAddress(endpointUrl);
}
if (partnerEndpoint.isSecurityEnabled()) {
String secPolicyKey = partnerEndpoint.getWsSecPolicyKey();
if (secPolicyKey.startsWith(UnifiedEndpointConstants.VIRTUAL_FILE)) {
String secPolicyLocation = secPolicyKey.substring(
UnifiedEndpointConstants.VIRTUAL_FILE.length());
if (!isAbsoutePath(secPolicyLocation)) {
secPolicyKey = getAbsolutePath(endpointConfiguration.getBasePath(),
secPolicyLocation);
} else {
secPolicyKey = UnifiedEndpointConstants.VIRTUAL_FILE + secPolicyLocation;
}
partnerEndpoint.setWsSecPolicyKey(secPolicyKey);
}
}
return partnerEndpoint;
}