1 19 20 package org.netbeans.modules.websvc.api.jaxws.wsdlmodel; 21 22 import com.sun.tools.ws.processor.model.Operation; 23 import com.sun.tools.ws.processor.model.Port; 24 import com.sun.tools.ws.wsdl.document.soap.SOAPStyle; 25 import java.util.ArrayList ; 26 import java.util.List ; 27 28 32 public class WsdlPort { 33 public static final String STYLE_DOCUMENT="document"; public static final String STYLE_RPC="rpc"; public static final String SOAP_VERSION_11="http://schemas.xmlsoap.org/wsdl/soap/http"; public static final String SOAP_VERSION_12="http://www.w3.org/2003/05/soap/bindings/HTTP/"; 38 private Port port; 39 private String soapVersion = SOAP_VERSION_11; 40 41 42 WsdlPort(Port port) { 43 this.port=port; 44 } 45 46 public Object getInternalJAXWSPort() { 47 return port; 48 } 49 50 public List <WsdlOperation> getOperations() { 51 List <WsdlOperation> wsdlOperations = new ArrayList <WsdlOperation> (); 52 if (port==null) return wsdlOperations; 53 List <Operation> operations = port.getOperations(); 54 for (Operation op:operations) 55 wsdlOperations.add(new WsdlOperation(op)); 56 return wsdlOperations; 57 } 58 59 public String getName() { 60 if (port==null) return null; 61 return port.getName().getLocalPart(); 62 } 63 64 public String getNamespaceURI() { 65 return port.getName().getNamespaceURI(); 66 } 67 68 public String getJavaName() { 69 if (port==null) return null; 70 return port.getJavaInterface().getName(); 71 } 72 73 public String getPortGetter() { 74 if (port==null) return null; 75 return port.getPortGetter(); 76 } 77 78 public String getSOAPVersion() { 79 return soapVersion; 80 } 81 82 public void setSOAPVersion(String soapVersion) { 83 this.soapVersion=soapVersion; 84 } 85 86 public String getStyle() { 87 SOAPStyle style = port.getStyle(); 88 if (SOAPStyle.DOCUMENT.equals(style)) return STYLE_DOCUMENT; 89 else if (SOAPStyle.RPC.equals(style)) return STYLE_RPC; 90 return null; 91 } 92 93 public boolean isProvider(){ 94 return port.isProvider(); 95 } 96 } 97 | Popular Tags |