org.apache.axis.client.Service.getPort()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(266)

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

Service.getPort介绍

[英]Return a dynamic proxy for the given proxy interface.
[中]返回给定代理接口的动态代理。

代码示例

代码示例来源:origin: org.apache.axis/axis

/**
 * Return an object which acts as a dynamic proxy for the passed
 * interface class.  This is a more "dynamic" version in that it
 * doesn't actually require WSDL, simply an endpoint address.
 *
 * Note: Not part of the JAX-RPC spec.
 *
 * @param endpoint the URL which will be used as the SOAP endpoint
 * @param proxyInterface the interface class which we wish to mimic
 *                       via a dynamic proxy
 * @throws ServiceException
 */
public Remote getPort(String endpoint, Class proxyInterface)
    throws ServiceException {
  return getPort(endpoint, null, proxyInterface);
}

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

/**
 * Return an object which acts as a dynamic proxy for the passed
 * interface class.  This is a more "dynamic" version in that it
 * doesn't actually require WSDL, simply an endpoint address.
 *
 * Note: Not part of the JAX-RPC spec.
 *
 * @param endpoint the URL which will be used as the SOAP endpoint
 * @param proxyInterface the interface class which we wish to mimic
 *                       via a dynamic proxy
 * @throws ServiceException
 */
public Remote getPort(String endpoint, Class proxyInterface)
    throws ServiceException {
  return getPort(endpoint, null, proxyInterface);
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Return an object which acts as a dynamic proxy for the passed
 * interface class.  This is a more "dynamic" version in that it
 * doesn't actually require WSDL, simply an endpoint address.
 *
 * Note: Not part of the JAX-RPC spec.
 *
 * @param endpoint the URL which will be used as the SOAP endpoint
 * @param proxyInterface the interface class which we wish to mimic
 *                       via a dynamic proxy
 * @throws ServiceException
 */
public Remote getPort(String endpoint, Class proxyInterface)
    throws ServiceException {
  return getPort(endpoint, null, proxyInterface);
}

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

/**
 * Return a dynamic proxy for the given proxy interface.
 *
 * @param  proxyInterface  The Remote object returned by this
 * method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation
 * @throws ServiceException If there's an error
 */
public Remote getPort(Class proxyInterface) throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Map ports = wsdlService.getPorts();
  if (ports == null || ports.size() <= 0)
    throw new ServiceException(Messages.getMessage("noPort00", ""));
  // Get the name of the class (without package name)
  String clazzName = proxyInterface.getName();
  if(clazzName.lastIndexOf('.')!=-1) {
    clazzName = clazzName.substring(clazzName.lastIndexOf('.')+1);
  }
  // Pick the port with the same name as the class
  Port port = (Port) ports.get(clazzName);
  if(port == null) {
    // If not found, just pick the first port.
    port = (Port) ports.values().iterator().next();
  }
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(new QName(port.getName()), proxyInterface);
  return stub != null ? stub : getPort(null, new QName(port.getName()), proxyInterface);
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Return a dynamic proxy for the given proxy interface.
 *
 * @param  proxyInterface  The Remote object returned by this
 * method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation
 * @throws ServiceException If there's an error
 */
public Remote getPort(Class proxyInterface) throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Map ports = wsdlService.getPorts();
  if (ports == null || ports.size() <= 0)
    throw new ServiceException(Messages.getMessage("noPort00", ""));
  // Get the name of the class (without package name)
  String clazzName = proxyInterface.getName();
  if(clazzName.lastIndexOf('.')!=-1) {
    clazzName = clazzName.substring(clazzName.lastIndexOf('.')+1);
  }
  // Pick the port with the same name as the class
  Port port = (Port) ports.get(clazzName);
  if(port == null) {
    // If not found, just pick the first port.
    port = (Port) ports.values().iterator().next();
  }
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(new QName(port.getName()), proxyInterface);
  return stub != null ? stub : getPort(null, new QName(port.getName()), proxyInterface);
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Return a dynamic proxy for the given proxy interface.
 *
 * @param  proxyInterface  The Remote object returned by this
 * method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation
 * @throws ServiceException If there's an error
 */
public Remote getPort(Class proxyInterface) throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Map ports = wsdlService.getPorts();
  if (ports == null || ports.size() <= 0)
    throw new ServiceException(Messages.getMessage("noPort00", ""));
  // Get the name of the class (without package name)
  String clazzName = proxyInterface.getName();
  if(clazzName.lastIndexOf('.')!=-1) {
    clazzName = clazzName.substring(clazzName.lastIndexOf('.')+1);
  }
  // Pick the port with the same name as the class
  Port port = (Port) ports.get(clazzName);
  if(port == null) {
    // If not found, just pick the first port.
    port = (Port) ports.values().iterator().next();
  }
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(new QName(port.getName()), proxyInterface);
  return stub != null ? stub : getPort(null, new QName(port.getName()), proxyInterface);
}

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

/**
 * Return either an instance of a generated stub, if it can be
 * found, or a dynamic proxy for the given proxy interface.
 *
 * @param  portName        The name of the service port
 * @param  proxyInterface  The Remote object returned by this
 *         method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation.
 * @throws ServiceException If there's an error
 */
public Remote getPort(QName portName, Class proxyInterface)
    throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Port port = wsdlService.getPort(portName.getLocalPart());
  if (port == null)
    throw new ServiceException(Messages.getMessage("noPort00", "" + portName));
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(portName, proxyInterface);
  return stub != null ? stub : getPort(null, portName, proxyInterface);
}

代码示例来源:origin: org.apache.axis/axis

/**
 * Return either an instance of a generated stub, if it can be
 * found, or a dynamic proxy for the given proxy interface.
 *
 * @param  portName        The name of the service port
 * @param  proxyInterface  The Remote object returned by this
 *         method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation.
 * @throws ServiceException If there's an error
 */
public Remote getPort(QName portName, Class proxyInterface)
    throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Port port = wsdlService.getPort(portName.getLocalPart());
  if (port == null)
    throw new ServiceException(Messages.getMessage("noPort00", "" + portName));
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(portName, proxyInterface);
  return stub != null ? stub : getPort(null, portName, proxyInterface);
}

代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis

/**
 * Return either an instance of a generated stub, if it can be
 * found, or a dynamic proxy for the given proxy interface.
 *
 * @param  portName        The name of the service port
 * @param  proxyInterface  The Remote object returned by this
 *         method will also implement the given proxyInterface
 * @return java.rmi.Remote The stub implementation.
 * @throws ServiceException If there's an error
 */
public Remote getPort(QName portName, Class proxyInterface)
    throws ServiceException {
  if (wsdlService == null)
    throw new ServiceException(Messages.getMessage("wsdlMissing00"));
  Port port = wsdlService.getPort(portName.getLocalPart());
  if (port == null)
    throw new ServiceException(Messages.getMessage("noPort00", "" + portName));
  // First, try to find a generated stub.  If that
  // returns null, then find a dynamic stub.
  Remote stub = getGeneratedStub(portName, proxyInterface);
  return stub != null ? stub : getPort(null, portName, proxyInterface);
}

相关文章