1 19 20 package org.netbeans.modules.websvc.api.jaxws.wsdlmodel; 21 22 import com.sun.tools.ws.processor.model.Port; 23 import com.sun.tools.ws.processor.model.Service; 24 import java.util.*; 25 26 30 public class WsdlService { 31 32 private Service service; 33 34 WsdlService(Service service) { 35 this.service=service; 36 } 37 38 public Object getInternalJAXWSService() { 39 return service; 40 } 41 42 public List<WsdlPort> getPorts() { 43 List<WsdlPort> wsdlPorts = new ArrayList<WsdlPort>(); 44 if (service==null) return wsdlPorts; 45 List<Port> ports = service.getPorts(); 46 for (Port p:ports) 47 wsdlPorts.add(new WsdlPort(p)); 48 return wsdlPorts; 49 } 50 51 public String getName() { 52 if (service==null) return null; 53 return service.getName().getLocalPart(); 54 } 55 56 public String getNamespaceURI() { 57 return service.getName().getNamespaceURI(); 58 } 59 60 public String getJavaName() { 61 if (service==null) return null; 62 return service.getJavaInterface().getName(); 63 } 64 65 public WsdlPort getPortByName(String portName) { 66 List<Port> ports = service.getPorts(); 67 for (Port p:ports) 68 if (portName.equals(p.getName().getLocalPart())) return new WsdlPort(p); 69 return null; 70 } 71 } 72 | Popular Tags |