}
return portType;
}
protected void overrideDefinition(Definition def) throws Exception {
PortType portType = getTargetPortType(def);
if (portType != null) {
QName[] names = (QName[]) def.getPortTypes().keySet().toArray(new QName[0]);
for (int i = 0; i < names.length; i++) {
if (!names[i].equals(portType.getQName())) {
def.removePortType(names[i]);
}
}
names = (QName[]) def.getServices().keySet().toArray(new QName[0]);
for (int i = 0; i < names.length; i++) {
def.removeService(names[i]);
}
names = (QName[]) def.getBindings().keySet().toArray(new QName[0]);
for (int i = 0; i < names.length; i++) {
def.removeBinding(names[i]);
}
String location = getLocationURI();
if (!location.endsWith("/")) {
location += "/";
}
HttpComponent comp = (HttpComponent) getServiceUnit().getComponent();
if (comp.getConfiguration().isManaged()) {
// Save the path
String path = new URI(location).getPath();
location = "http://localhost";
if (comp.getHost() != null) {
if (comp.getProtocol() != null) {
location = comp.getProtocol() + "://";
} else {
location = "http://";
}
location += comp.getHost();
if (comp.getPort() != 80) {
location += ":" + comp.getPort();
}
if (comp.getPath() != null) {
location += comp.getPath();
}
}
location += comp.getConfiguration().getMapping() + path;
}
if (portType.getQName().getNamespaceURI().equals(service.getNamespaceURI())) {
if (isSoap()) {
PortTypeDecorator.decorate(
def,
portType,
location,