Port port = (Port) portItr.next();
List list = port.getExtensibilityElements();
for (int i = 0; i < list.size(); i++) {
Object extensibilityEle = list.get(i);
if (extensibilityEle instanceof SOAPAddress) {
SOAPAddress soapAddress = (SOAPAddress) extensibilityEle;
String existingAddress = soapAddress.getLocationURI();
if (existingAddress == null
|| existingAddress
.equals("REPLACE_WITH_ACTUAL_URL")) {
((SOAPAddress) extensibilityEle)
.setLocationURI(getEPRs()[0]);
} else {
if (requestIP == null) {
((SOAPAddress) extensibilityEle)
.setLocationURI(getLocationURI(
getEPRs(), existingAddress));
} else {
((SOAPAddress) extensibilityEle)
.setLocationURI(getLocationURI(
calculateEPRs(requestIP),
existingAddress));
}
}
} else if (extensibilityEle instanceof SOAP12Address) {
SOAP12Address soapAddress = (SOAP12Address) extensibilityEle;
String exsistingAddress = soapAddress.getLocationURI();
if (requestIP == null) {
((SOAP12Address) extensibilityEle)
.setLocationURI(getLocationURI(getEPRs(),
exsistingAddress));
} else {