}
private Remote getPort(String endpoint, QName portName,
Class proxyInterface) throws ServiceException {
if (!proxyInterface.isInterface()) {
throw new ServiceException(JavaUtils.getMessage("mustBeIface00"));
}
if (!(Remote.class.isAssignableFrom(proxyInterface))) {
throw new ServiceException(
JavaUtils.getMessage("mustExtendRemote00"));
}
try {
Call call = null;
if (portName == null) {
call = (org.apache.axis.client.Call) createCall();
if (endpoint != null) {
call.setTargetEndpointAddress(new URL(endpoint));
}
}
else {
call = (org.apache.axis.client.Call) createCall(portName);
}
ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
return (Remote)Proxy.newProxyInstance(classLoader,
new Class[] { proxyInterface, javax.xml.rpc.Stub.class },
new AxisClientProxy(call));
} catch (Exception e) {
throw new ServiceException(e.toString());
}
} // getPort