本文整理了Java中javax.wsdl.Port.setName()
方法的一些代码示例,展示了Port.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Port.setName()
方法的具体详情如下:
包路径:javax.wsdl.Port
类名称:Port
方法名:setName
[英]Set the name of this port.
[中]设置此端口的名称。
代码示例来源:origin: wsdl4j/wsdl4j
port.setName(name);
代码示例来源:origin: org.springframework.ws/org.springframework.ws
/**
* Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
* this method to define the port name, or add extensions to it.
* <p/>
* Default implementation sets the port name to the binding name.
*
* @param definition the WSDL4J <code>Definition</code>
* @param port the WSDL4J <code>Port</code>
* @throws WSDLException in case of errors
*/
protected void populatePort(Definition definition, Port port) throws WSDLException {
String portName = port.getBinding().getQName().getLocalPart();
port.setName(portName);
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
/**
* Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
* this method to define the port name, or add extensions to it.
*
* <p>Default implementation sets the port name to the binding name.
*
* @param definition the WSDL4J {@code Definition}
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
*/
protected void populatePort(Definition definition, Port port) throws WSDLException {
String portName = port.getBinding().getQName().getLocalPart();
port.setName(portName);
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
* this method to define the port name, or add extensions to it.
*
* <p>Default implementation sets the port name to the binding name.
*
* @param definition the WSDL4J {@code Definition}
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
*/
protected void populatePort(Definition definition, Port port) throws WSDLException {
String portName = port.getBinding().getQName().getLocalPart();
port.setName(portName);
}
代码示例来源:origin: spring-projects/spring-ws
/**
* Called after the {@link Port} has been created, but before any sub-elements are added. Subclasses can implement
* this method to define the port name, or add extensions to it.
*
* <p>Default implementation sets the port name to the binding name.
*
* @param definition the WSDL4J {@code Definition}
* @param port the WSDL4J {@code Port}
* @throws WSDLException in case of errors
*/
protected void populatePort(Definition definition, Port port) throws WSDLException {
String portName = port.getBinding().getQName().getLocalPart();
port.setName(portName);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-wsdlgen
protected void configurePort(Port port, Binding binding) throws WSDLException {
if ( wsBindingName != null ) {
port.setName(wsBindingName + getSOAPVersionString() + PORT_SUFFIX);
} else if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
protected void configurePort(Port port, Binding binding) throws WSDLException {
if ( wsBindingName != null ) {
port.setName(wsBindingName + getSOAPVersionString() + PORT_SUFFIX);
} else if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX);
}
}
代码示例来源:origin: org.codehaus.xfire/xfire-core
public Port createPort(Endpoint endpoint, WSDLBuilder builder, javax.wsdl.Binding wbinding)
{
SOAPAddressImpl add = new SOAPAddressImpl();
add.setLocationURI(endpoint.getUrl());
Port port = builder.getDefinition().createPort();
port.setBinding( wbinding );
port.setName( endpoint.getName().getLocalPart() );
port.addExtensibilityElement( add );
return port;
}
代码示例来源:origin: apache/cxf
public static javax.wsdl.Service doAppendService(Definition wsdlDefinition,
String existPortName, ExtensionRegistry
extReg, Binding binding) throws Exception {
javax.wsdl.Service wsdlService = wsdlDefinition.createService();
wsdlService.setQName(new QName(wsdlDefinition.getTargetNamespace(), existPortName + serviceName));
Port port = wsdlDefinition.createPort();
port.setName(existPortName + portName);
port.setBinding(binding);
SOAPAddress address = PartialWSDLProcessor.setAddrElement(wsdlDefinition, port, extReg);
port.addExtensibilityElement(address);
wsdlService.addPort(port);
return wsdlService;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-core
public static javax.wsdl.Service doAppendService(Definition wsdlDefinition,
String existPortName, ExtensionRegistry
extReg, Binding binding) throws Exception {
javax.wsdl.Service wsdlService = wsdlDefinition.createService();
wsdlService.setQName(new QName(wsdlDefinition.getTargetNamespace(), existPortName + serviceName));
Port port = wsdlDefinition.createPort();
port.setName(existPortName + portName);
port.setBinding(binding);
SOAPAddress address = PartialWSDLProcessor.setAddrElement(wsdlDefinition, port, extReg);
port.addExtensibilityElement(address);
wsdlService.addPort(port);
return wsdlService;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static javax.wsdl.Service doAppendService(Definition wsdlDefinition,
String existPortName, ExtensionRegistry
extReg, Binding binding) throws Exception {
javax.wsdl.Service wsdlService = wsdlDefinition.createService();
wsdlService.setQName(new QName(wsdlDefinition.getTargetNamespace(), existPortName + serviceName));
Port port = wsdlDefinition.createPort();
port.setName(existPortName + portName);
port.setBinding(binding);
SOAPAddress address = PartialWSDLProcessor.setAddrElement(wsdlDefinition, port, extReg);
port.addExtensibilityElement(address);
wsdlService.addPort(port);
return wsdlService;
}
代码示例来源:origin: apache/cxf
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
}
代码示例来源:origin: org.apache.cxf/cxf-tools-misctools
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
}
代码示例来源:origin: org.objectweb.celtix/celtix-tools
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
}
代码示例来源:origin: org.codehaus.xfire/xfire-core
public Port createPort(WSDLBuilder builder, javax.wsdl.Binding wbinding)
{
Transport t = builder.getTransportManager().getTransport(getBindingId());
if (!(t instanceof WSDL11Transport)) return null;
WSDL11Transport transport = (WSDL11Transport) t;
SOAPAddressImpl add = new SOAPAddressImpl();
add.setLocationURI(transport.getServiceURL(builder.getService()));
Port port = builder.getDefinition().createPort();
port.setBinding( wbinding );
QName portName = (QName) builder.getService().getProperty(ObjectServiceFactory.PORT_NAME);
if (portName != null)
{
port.setName(portName.getLocalPart());
}
else
{
port.setName( builder.getService().getSimpleName() + transport.getName() + "Port" );
}
port.addExtensibilityElement( add );
return port;
}
}
代码示例来源:origin: org.objectweb.celtix/celtix-tools
public void generate() {
Service service = definition.createService();
service.setQName(new QName(WSDLConstants.WSDL_PREFIX, wmodel.getServiceName()));
Port port = definition.createPort();
port.setName(wmodel.getPortName());
Binding binding = definition.createBinding();
String targetNameSpace = wmodel.getTargetNameSpace();
binding.setQName(new QName(targetNameSpace, wmodel.getPortTypeName() + "Binding"));
port.setBinding(binding);
SOAPAddress soapAddress = null;
try {
soapAddress = (SOAPAddress)extensionRegistry
.createExtension(Port.class, new QName(WSDLConstants.SOAP11_NAMESPACE, "address"));
soapAddress.setLocationURI(ADDRESS_URI);
} catch (WSDLException e) {
throw new ToolException(e.getMessage(), e);
}
port.addExtensibilityElement(soapAddress);
service.addPort(port);
definition.addService(service);
}
}
代码示例来源:origin: apache/cxf
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
Writer outputWriter = getOutputWriter(NEW_FILE_NAME_MODIFIER);
try {
wsdlWriter.writeWSDL(wsdlDefinition, outputWriter);
} catch (WSDLException wse) {
Message msg = new Message("FAIL_TO_WRITE_WSDL", LOG);
throw new ToolException(msg, wse);
}
try {
outputWriter.close();
} catch (IOException ioe) {
Message msg = new Message("FAIL_TO_CLOSE_WSDL_FILE", LOG);
throw new ToolException(msg, ioe);
}
}
代码示例来源:origin: org.objectweb.celtix/celtix-tools
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
Writer outputWriter = getOutputWriter(NEW_FILE_NAME_MODIFIER);
try {
wsdlWriter.writeWSDL(wsdlDefinition, outputWriter);
} catch (WSDLException wse) {
Message msg = new Message("FAIl_TO_WRITE_WSDL", LOG);
throw new ToolException(msg, wse);
}
try {
outputWriter.close();
} catch (IOException ioe) {
Message msg = new Message("FAIL_TO_CLOSE_WSDL_FILE", LOG);
throw new ToolException(msg, ioe);
}
}
代码示例来源:origin: org.apache.cxf/cxf-tools-misctools
private void doAppendService() throws ToolException {
if (service == null) {
service = wsdlDefinition.createService();
service
.setQName(new QName(WSDLConstants.WSDL_PREFIX, (String)env.get(ToolConstants.CFG_SERVICE)));
}
if (port == null) {
port = wsdlDefinition.createPort();
port.setName((String)env.get(ToolConstants.CFG_PORT));
port.setBinding(binding);
}
setAddrElement();
service.addPort(port);
wsdlDefinition.addService(service);
WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
Writer outputWriter = getOutputWriter(NEW_FILE_NAME_MODIFIER);
try {
wsdlWriter.writeWSDL(wsdlDefinition, outputWriter);
} catch (WSDLException wse) {
Message msg = new Message("FAIL_TO_WRITE_WSDL", LOG);
throw new ToolException(msg, wse);
}
try {
outputWriter.close();
} catch (IOException ioe) {
Message msg = new Message("FAIL_TO_CLOSE_WSDL_FILE", LOG);
throw new ToolException(msg, ioe);
}
}
代码示例来源:origin: org.apache.axis/axis
port.setName(getServicePortName());
内容来源于网络,如有侵权,请联系作者删除!