Collection endpoints = webService.getEndpoints();
for(Iterator iter = endpoints.iterator(); iter.hasNext(); ) {
WebServiceEndpoint next = (WebServiceEndpoint) iter.next();
Service service = wsUtil.getServiceForPort(model,
next.getWsdlPort());
if( service == null ) {
service = (Service) model.getServices().next();
System.out.println("Warning : Can't find Service for Endpoint '"
+ next.getEndpointName() + "' Port '" +
next.getWsdlPort() + "'");
System.out.println("Defaulting to "+ service.getName());
}
QName serviceName = service.getName();
next.setServiceNamespaceUri(serviceName.getNamespaceURI());
next.setServiceLocalPart(serviceName.getLocalPart());
Port port = wsUtil.getPortFromModel(model, next.getWsdlPort());