javax.wsdl.Binding.setQName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(13.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中javax.wsdl.Binding.setQName()方法的一些代码示例,展示了Binding.setQName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.setQName()方法的具体详情如下:
包路径:javax.wsdl.Binding
类名称:Binding
方法名:setQName

Binding.setQName介绍

[英]Set the name of this binding.
[中]设置此绑定的名称。

代码示例

代码示例来源:origin: wsdl4j/wsdl4j

binding.setQName(bindingStr);
def.addBinding(binding);

代码示例来源:origin: wsdl4j/wsdl4j

binding.setQName(bindingName);

代码示例来源:origin: apache/servicemix-bundles

/**
 * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
 * this method to define the binding name, or add extensions to it.
 *
 * <p>Default implementation sets the binding name to the port type name with the {@link #getBindingSuffix() suffix}
 * appended to it.
 *
 * @param definition the WSDL4J {@code Definition}
 * @param binding     the WSDL4J {@code Binding}
 */
protected void populateBinding(Definition definition, Binding binding) throws WSDLException {
  QName portTypeName = binding.getPortType().getQName();
  if (portTypeName != null) {
    QName bindingName =
        new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + getBindingSuffix());
    if (logger.isDebugEnabled()) {
      logger.debug("Creating binding [" + bindingName + "]");
    }
    binding.setQName(bindingName);
  }
}

代码示例来源:origin: org.springframework.ws/spring-ws-core

/**
 * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
 * this method to define the binding name, or add extensions to it.
 *
 * <p>Default implementation sets the binding name to the port type name with the {@link #getBindingSuffix() suffix}
 * appended to it.
 *
 * @param definition the WSDL4J {@code Definition}
 * @param binding     the WSDL4J {@code Binding}
 */
protected void populateBinding(Definition definition, Binding binding) throws WSDLException {
  QName portTypeName = binding.getPortType().getQName();
  if (portTypeName != null) {
    QName bindingName =
        new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + getBindingSuffix());
    if (logger.isDebugEnabled()) {
      logger.debug("Creating binding [" + bindingName + "]");
    }
    binding.setQName(bindingName);
  }
}

代码示例来源:origin: org.springframework.ws/org.springframework.ws

/**
 * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
 * this method to define the binding name, or add extensions to it.
 * <p/>
 * Default implementation sets the binding name to the port type name with the {@link #getBindingSuffix() suffix}
 * appended to it.
 *
 * @param definition the WSDL4J <code>Definition</code>
 * @param binding    the WSDL4J <code>Binding</code>
 */
protected void populateBinding(Definition definition, Binding binding) throws WSDLException {
  QName portTypeName = binding.getPortType().getQName();
  if (portTypeName != null) {
    QName bindingName =
        new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + getBindingSuffix());
    if (logger.isDebugEnabled()) {
      logger.debug("Creating binding [" + bindingName + "]");
    }
    binding.setQName(bindingName);
  }
}

代码示例来源:origin: spring-projects/spring-ws

/**
 * Called after the {@link Binding} has been created, but before any sub-elements are added. Subclasses can override
 * this method to define the binding name, or add extensions to it.
 *
 * <p>Default implementation sets the binding name to the port type name with the {@link #getBindingSuffix() suffix}
 * appended to it.
 *
 * @param definition the WSDL4J {@code Definition}
 * @param binding     the WSDL4J {@code Binding}
 */
protected void populateBinding(Definition definition, Binding binding) throws WSDLException {
  QName portTypeName = binding.getPortType().getQName();
  if (portTypeName != null) {
    QName bindingName =
        new QName(portTypeName.getNamespaceURI(), portTypeName.getLocalPart() + getBindingSuffix());
    if (logger.isDebugEnabled()) {
      logger.debug("Creating binding [" + bindingName + "]");
    }
    binding.setQName(bindingName);
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-wsdlgen

protected void configureBinding(Definition definition, Binding binding, PortType portType) throws WSDLException {
  if ( wsBindingName != null ) {
    QName name = new QName(definition.getTargetNamespace(), wsBindingName + getSOAPVersionString() + BINDING_SUFFIX);
    if ( definition.getBinding(name) == null ) {
      binding.setQName(name);
      return;
    }
  }
  
  QName portTypeName = portType.getQName();
  if (portTypeName != null) {
    // Choose <porttype>Binding if available.  If this name is in use, insert
    // separating underscores until there is no clash.
    for (String suffix = BINDING_SUFFIX; ; suffix = "_" + suffix) { 
      QName name = new QName(definition.getTargetNamespace(), portTypeName.getLocalPart() + suffix);
      if (definition.getBinding(name) == null) {
        binding.setQName(name);
        break;
      }
    }
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

protected void configureBinding(Definition definition, Binding binding, PortType portType) throws WSDLException {
  if ( wsBindingName != null ) {
    QName name = new QName(definition.getTargetNamespace(), wsBindingName + getSOAPVersionString() + BINDING_SUFFIX);
    if ( definition.getBinding(name) == null ) {
      binding.setQName(name);
      return;
    }
  }
  
  QName portTypeName = portType.getQName();
  if (portTypeName != null) {
    // Choose <porttype>Binding if available.  If this name is in use, insert
    // separating underscores until there is no clash.
    for (String suffix = BINDING_SUFFIX; ; suffix = "_" + suffix) { 
      QName name = new QName(definition.getTargetNamespace(), portTypeName.getLocalPart() + suffix);
      if (definition.getBinding(name) == null) {
        binding.setQName(name);
        break;
      }
    }
  }
}

代码示例来源:origin: apache/cxf

public static Binding doAppendBinding(Definition wsdlDefinition, String name, PortType portType,
                     ExtensionRegistry extReg) throws Exception {
  Binding binding = wsdlDefinition.createBinding();
  binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), name + bindingName));
  binding.setUndefined(false);
  binding.setPortType(portType);
  setSoapBindingExtElement(wsdlDefinition, binding, extReg);
  addBindingOperation(wsdlDefinition, portType, binding, extReg);
  return binding;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

public static Binding doAppendBinding(Definition wsdlDefinition, String name, PortType portType, 
                     ExtensionRegistry extReg) throws Exception {
  Binding binding = wsdlDefinition.createBinding();
  binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), name + bindingName));
  binding.setUndefined(false);
  binding.setPortType(portType);
  setSoapBindingExtElement(wsdlDefinition, binding, extReg);
  addBindingOperation(wsdlDefinition, portType, binding, extReg);
  return binding;

}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

public static Binding doAppendBinding(Definition wsdlDefinition, String name, PortType portType, 
                     ExtensionRegistry extReg) throws Exception {
  Binding binding = wsdlDefinition.createBinding();
  binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), name + bindingName));
  binding.setUndefined(false);
  binding.setPortType(portType);
  setSoapBindingExtElement(wsdlDefinition, binding, extReg);
  addBindingOperation(wsdlDefinition, portType, binding, extReg);
  return binding;

}

代码示例来源:origin: org.apache.airavata/gfac-schema-utils

private Binding addBinding(Definition def, String nameSpaceURI, PortTypeImpl portType,
    UnknownExtensibilityElement wsPolicyRef, DOMImplementation dImpl) {
  String portName = portType.getQName().getLocalPart();
  Binding binding = def.createBinding();
  binding.setQName(new QName(nameSpaceURI, portName + WSDL_SOAP_BINDING_SUFFIX));
  binding.setUndefined(false);
  binding.setPortType(portType);
  SOAPBindingImpl soapBindingImpl = new SOAPBindingImpl();
  soapBindingImpl.setStyle(DOCUMENT);
  soapBindingImpl.setTransportURI(SOAP_HTTP_NAMESPACE);
  binding.addExtensibilityElement(soapBindingImpl);
  if (wsPolicyRef != null) {
    log.info("policy info is not null");
    binding.addExtensibilityElement(wsPolicyRef);
  }
  Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);
  UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
  exEle.setElement(doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
  exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
  binding.addExtensibilityElement(exEle);
  return binding;
}

代码示例来源:origin: org.apache.airavata/airavata-gfac-schema-utils

private Binding addBinding(Definition def, String nameSpaceURI, PortTypeImpl portType,
    UnknownExtensibilityElement wsPolicyRef, DOMImplementation dImpl) {
  String portName = portType.getQName().getLocalPart();
  Binding binding = def.createBinding();
  binding.setQName(new QName(nameSpaceURI, portName + WSDL_SOAP_BINDING_SUFFIX));
  binding.setUndefined(false);
  binding.setPortType(portType);
  SOAPBindingImpl soapBindingImpl = new SOAPBindingImpl();
  soapBindingImpl.setStyle(DOCUMENT);
  soapBindingImpl.setTransportURI(SOAP_HTTP_NAMESPACE);
  binding.addExtensibilityElement(soapBindingImpl);
  if (wsPolicyRef != null) {
    log.debug("policy info is not null");
    binding.addExtensibilityElement(wsPolicyRef);
  }
  Document doc = dImpl.createDocument(WSP_NAMESPACE, "Misc", null);
  UnknownExtensibilityElement exEle = new UnknownExtensibilityElement();
  exEle.setElement(doc.createElementNS("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
  exEle.setElementType(new QName("http://www.w3.org/2006/05/addressing/wsdl", "wsaw:UsingAddressing"));
  binding.addExtensibilityElement(exEle);
  return binding;
}

代码示例来源:origin: apache/cxf

private void doAppendBinding() throws ToolException {
  if (binding == null) {
    binding = wsdlDefinition.createBinding();
    binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), (String)env
      .get(ToolConstants.CFG_BINDING)));
    binding.setUndefined(false);
    binding.setPortType(portType);
  }
  setXMLBindingExtElement();
  addBindingOperation();
  wsdlDefinition.addBinding(binding);
}

代码示例来源:origin: org.objectweb.celtix/celtix-tools

private void doAppendBinding() throws ToolException {
  if (binding == null) {
    binding = wsdlDefinition.createBinding();
    binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), (String)env
      .get(ToolConstants.CFG_BINDING)));
    binding.setUndefined(false);
    binding.setPortType(portType);
  }
  setXMLBindingExtElement();
  addBindingOperation();
  wsdlDefinition.addBinding(binding);
}

代码示例来源:origin: org.apache.cxf/cxf-tools-misctools

private void doAppendBinding() throws ToolException {
  if (binding == null) {
    binding = wsdlDefinition.createBinding();
    binding.setQName(new QName(wsdlDefinition.getTargetNamespace(), (String)env
      .get(ToolConstants.CFG_BINDING)));
    binding.setUndefined(false);
    binding.setPortType(portType);
  }
  setXMLBindingExtElement();
  addBindingOperation();
  wsdlDefinition.addBinding(binding);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

protected void buildBinding(Definition definition,
              Collection<BindingInfo> bindingInfos,
              Collection<PortType> portTypes) {
  Binding binding = null;
  for (BindingInfo bindingInfo : bindingInfos) {
    binding = definition.createBinding();
    addDocumentation(binding, bindingInfo.getDocumentation());
    binding.setUndefined(false);
    for (PortType portType : portTypes) {
      if (portType.getQName().equals(bindingInfo.getInterface().getName())) {
        binding.setPortType(portType);
        break;
      }
    }
    binding.setQName(bindingInfo.getName());
    if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) {
      addNamespace(bindingInfo.getName().getNamespaceURI(), definition);
    }
    buildBindingOperation(definition, binding, bindingInfo.getOperations());
    addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo));
    definition.addBinding(binding);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

protected void buildBinding(Definition definition,
              Collection<BindingInfo> bindingInfos,
              Collection<PortType> portTypes) {
  Binding binding = null;
  for (BindingInfo bindingInfo : bindingInfos) {
    binding = definition.createBinding();
    addDocumentation(binding, bindingInfo.getDocumentation());
    binding.setUndefined(false);
    for (PortType portType : portTypes) {
      if (portType.getQName().equals(bindingInfo.getInterface().getName())) {
        binding.setPortType(portType);
        break;
      }
    }
    binding.setQName(bindingInfo.getName());
    if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) {
      addNamespace(bindingInfo.getName().getNamespaceURI(), definition);
    }
    buildBindingOperation(definition, binding, bindingInfo.getOperations());
    addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo));
    definition.addBinding(binding);
  }
}

代码示例来源:origin: apache/cxf

protected void buildBinding(Definition definition,
              Collection<BindingInfo> bindingInfos,
              Collection<PortType> portTypes) {
  Binding binding = null;
  for (BindingInfo bindingInfo : bindingInfos) {
    binding = definition.createBinding();
    addDocumentation(binding, bindingInfo.getDocumentation());
    binding.setUndefined(false);
    for (PortType portType : portTypes) {
      if (portType.getQName().equals(bindingInfo.getInterface().getName())) {
        binding.setPortType(portType);
        break;
      }
    }
    binding.setQName(bindingInfo.getName());
    if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) {
      addNamespace(bindingInfo.getName().getNamespaceURI(), definition);
    }
    buildBindingOperation(definition, binding, bindingInfo.getOperations());
    addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo));
    definition.addBinding(binding);
  }
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public javax.wsdl.Binding createBinding(WSDLBuilder builder, PortType portType)
{
  Transport t = builder.getTransportManager().getTransport(getBindingId());
  if (!(t instanceof WSDL11Transport)) return null;
  
  Definition def = builder.getDefinition();
  javax.wsdl.Binding wbinding = def.createBinding(); 
  wbinding.setQName( getName() );
  wbinding.setPortType( portType );
  wbinding.setUndefined(false);
  
  // add in soap:Body, et al
  wbinding.addExtensibilityElement(createSoapBinding());
  
  for (Iterator oitr = getService().getServiceInfo().getOperations().iterator(); oitr.hasNext();)
  {
    OperationInfo op = (OperationInfo) oitr.next();
    javax.wsdl.Operation wsdlOp = 
      (javax.wsdl.Operation) portType.getOperation(op.getName(), null, null);
    javax.wsdl.BindingOperation bop = createBindingOperation(builder, wsdlOp, op);
    createHeaders(builder, op, bop);
    
    wbinding.addBindingOperation(bop);
  }
  def.addBinding(wbinding);
  
  return wbinding;
}

相关文章