本文整理了Java中org.apache.axis.client.Service.getGeneratedStub()
方法的一些代码示例,展示了Service.getGeneratedStub()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Service.getGeneratedStub()
方法的具体详情如下:
包路径:org.apache.axis.client.Service
类名称:Service
方法名:getGeneratedStub
[英]With the proxyInterface and the service's portName, we have ALMOST enough info to find a generated stub. The generated stub is named after the binding, which we can get from the service's port. This binding is likely in the same namespace (ie, package) that the proxyInterface is in. So try to find and instantiate .Stub. If it doesn't exist, return null.
[中]通过proxyInterface和服务的portName,我们几乎有足够的信息来找到生成的存根。生成的存根以绑定命名,我们可以从服务的端口获得绑定。此绑定可能位于proxyInterface所在的同一命名空间(即包)中。所以试着找到并实例化。树桩。如果不存在,则返回null。
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!