service.setQName(new QName(def.getTargetNamespace(), serviceName));
Port port = def.createPort();
port.setName(portName);
port.setBinding(binding);
if (soap11) {
SOAPAddress address = new SOAPAddressImpl();
address.setLocationURI(locationUri);
port.addExtensibilityElement(address);
} else {
SOAP12Address address = new SOAP12AddressImpl();
address.setLocationURI(locationUri);
port.addExtensibilityElement(address);
}
service.addPort(port);
def.addService(service);
}