use of javax.xml.rpc.ServiceException in project vcell by virtualcell.
the class DataBaseReferenceReader method getChEBIName.
public static String getChEBIName(String chebiId) {
String name = null;
SearchCategory sc = SearchCategory.fromString(SearchCategory._value3);
int maxResults = 200;
StarsCategory starts = StarsCategory.value1;
ChebiWebServiceServiceLocator locator = new ChebiWebServiceServiceLocator();
ChebiWebServicePortType portType = null;
try {
portType = locator.getChebiWebServicePort();
LiteEntity[] le = portType.getLiteEntity(chebiId, sc, maxResults, starts);
if (le != null)
name = le[0].getChebiAsciiName();
// System.out.println((le!=null)?le[0].getChebiAsciiName():"cannot find" + chebiId);
} catch (ChebiWebServiceFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return name;
}
use of javax.xml.rpc.ServiceException in project spring-cloud-digital-sign by SpringForAll.
the class UserAPIServiceLocator method getPort.
/**
* For the given interface, get the stub implementation.
* If this service has no port for the given interface,
* then ServiceException is thrown.
*/
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws ServiceException {
try {
if (UserAPIServicePortType.class.isAssignableFrom(serviceEndpointInterface)) {
UserAPIServiceSoapBindingStub _stub = new UserAPIServiceSoapBindingStub(new java.net.URL(UserAPIServicePort_address), this);
_stub.setPortName(getUserAPIServicePortWSDDServiceName());
return _stub;
}
} catch (java.lang.Throwable t) {
throw new ServiceException(t);
}
throw new ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
}
use of javax.xml.rpc.ServiceException in project tomcat70 by apache.
the class ServiceProxy method getProxyPortQNameClass.
/**
* @param args Method call arguments
* @return Returns the correct Port
* @throws ServiceException if port's QName is an unknown Port (not defined in WSDL).
*/
@SuppressWarnings("unchecked")
private Object getProxyPortQNameClass(Object[] args) throws ServiceException {
QName name = (QName) args[0];
String nameString = name.getLocalPart();
Class<?> serviceendpointClass = (Class<?>) args[1];
for (Iterator<QName> ports = service.getPorts(); ports.hasNext(); ) {
QName portName = ports.next();
String portnameString = portName.getLocalPart();
if (portnameString.equals(nameString)) {
return service.getPort(name, serviceendpointClass);
}
}
// no ports have been found
throw new ServiceException("Port-component-ref : " + name + " not found");
}
use of javax.xml.rpc.ServiceException in project tomee by apache.
the class WsServlet method init.
public void init(ServletConfig config) throws ServletException {
this.config = config;
// this is only used by JaxRPC pojo services
pojo = createPojoInstance();
if (pojo instanceof ServiceLifecycle) {
try {
((ServiceLifecycle) pojo).init(new InstanceContext(config.getServletContext()));
} catch (ServiceException e) {
throw new ServletException("Unable to initialize ServiceEndpoint", e);
}
}
getService();
}
use of javax.xml.rpc.ServiceException in project tomee by apache.
the class SeiFactoryImpl method createServiceEndpoint.
public Remote createServiceEndpoint() throws ServiceException {
// TODO figure out why this can't be called in readResolve!
// synchronized (this) {
// if (!initialized) {
// initialize();
// initialized = true;
// }
// }
Service service = ((ServiceImpl) serviceImpl).getService();
GenericServiceEndpoint serviceEndpoint = new GenericServiceEndpoint(portQName, service, location);
Callback callback = new ServiceEndpointMethodInterceptor(serviceEndpoint, sortedOperationInfos, credentialsName);
Callback[] callbacks = new Callback[] { NoOp.INSTANCE, callback };
Enhancer.registerCallbacks(serviceEndpointClass, callbacks);
try {
return (Remote) constructor.newInstance(new Object[] { serviceEndpoint });
} catch (InvocationTargetException e) {
throw (ServiceException) new ServiceException("Could not construct service instance", e.getTargetException()).initCause(e);
}
}
Aggregations