Search in sources :

Example 6 with ServiceException

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;
}
Also used : SearchCategory(uk.ac.ebi.www.webservices.chebi.SearchCategory) ChebiWebServiceFault(uk.ac.ebi.www.webservices.chebi.ChebiWebServiceFault) ServiceException(javax.xml.rpc.ServiceException) ChebiWebServicePortType(uk.ac.ebi.www.webservices.chebi.ChebiWebServicePortType) ChebiWebServiceServiceLocator(uk.ac.ebi.www.webservices.chebi.ChebiWebServiceServiceLocator) RemoteException(java.rmi.RemoteException) StarsCategory(uk.ac.ebi.www.webservices.chebi.StarsCategory) LiteEntity(uk.ac.ebi.www.webservices.chebi.LiteEntity)

Example 7 with ServiceException

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()));
}
Also used : ServiceException(javax.xml.rpc.ServiceException)

Example 8 with ServiceException

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");
}
Also used : ServiceException(javax.xml.rpc.ServiceException) QName(javax.xml.namespace.QName)

Example 9 with ServiceException

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();
}
Also used : ServletException(javax.servlet.ServletException) ServiceException(javax.xml.rpc.ServiceException) ServiceLifecycle(javax.xml.rpc.server.ServiceLifecycle)

Example 10 with ServiceException

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);
    }
}
Also used : Callback(net.sf.cglib.proxy.Callback) ServiceException(javax.xml.rpc.ServiceException) Service(org.apache.axis.client.Service) Remote(java.rmi.Remote) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

ServiceException (javax.xml.rpc.ServiceException)18 RemoteException (java.rmi.RemoteException)7 Remote (java.rmi.Remote)3 AddInteractiveRequest (com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveRequest)2 AddInteractiveResponse (com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveResponse)2 Authentication (com.AddressDoctor.validator2.addInteractive.Interactive.Authentication)2 InteractiveSoap (com.AddressDoctor.validator2.addInteractive.Interactive.InteractiveSoap)2 Parameters (com.AddressDoctor.validator2.addInteractive.Interactive.Parameters)2 SessionHeader (com.salesforce.soap.partner.SessionHeader)2 SforceServiceLocator (com.salesforce.soap.partner.SforceServiceLocator)2 LoginFault (com.salesforce.soap.partner.fault.LoginFault)2 QName (javax.xml.namespace.QName)2 TicketServiceLocator (org.opennms.integration.otrs.ticketservice.TicketServiceLocator)2 TicketServicePort_PortType (org.opennms.integration.otrs.ticketservice.TicketServicePort_PortType)2 Address (com.AddressDoctor.validator2.addInteractive.Interactive.Address)1 Result (com.AddressDoctor.validator2.addInteractive.Interactive.Result)1 LoginResult (com.salesforce.soap.partner.LoginResult)1 ApiFault (com.salesforce.soap.partner.fault.ApiFault)1 ExceptionCode (com.salesforce.soap.partner.fault.ExceptionCode)1 IOException (java.io.IOException)1