Search in sources :

Example 11 with ServiceException

use of javax.xml.rpc.ServiceException in project tomee by apache.

the class ServiceImpl method getCalls.

public Call[] getCalls(QName portName) throws ServiceException {
    if (portName == null)
        throw new ServiceException("Portname cannot be null");
    SeiFactory factory = (SeiFactory) portToImplementationMap.get(portName.getLocalPart());
    if (factory == null)
        throw new ServiceException("No port for portname: " + portName);
    OperationInfo[] operationInfos = factory.getOperationInfos();
    javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[operationInfos.length];
    for (int i = 0; i < operationInfos.length; i++) {
        OperationInfo operation = operationInfos[i];
        array[i] = delegate.createCall(factory.getPortQName(), operation.getOperationName());
    }
    return array;
}
Also used : Call(javax.xml.rpc.Call) ServiceException(javax.xml.rpc.ServiceException)

Example 12 with ServiceException

use of javax.xml.rpc.ServiceException in project tomee by apache.

the class ServiceImpl method internalGetPort.

Remote internalGetPort(String portName) throws ServiceException {
    if (portToImplementationMap.containsKey(portName)) {
        SeiFactory seiFactory = (SeiFactory) portToImplementationMap.get(portName);
        Remote port = seiFactory.createServiceEndpoint();
        return port;
    }
    throw new ServiceException("No port for portname: " + portName);
}
Also used : ServiceException(javax.xml.rpc.ServiceException) Remote(java.rmi.Remote)

Example 13 with ServiceException

use of javax.xml.rpc.ServiceException in project tomee by apache.

the class ServiceImpl method internalGetPortFromClassName.

Remote internalGetPortFromClassName(String className) throws ServiceException {
    if (seiClassNameToFactoryMap.containsKey(className)) {
        SeiFactory seiFactory = (SeiFactory) seiClassNameToFactoryMap.get(className);
        Remote port = seiFactory.createServiceEndpoint();
        return port;
    }
    throw new ServiceException("no port for class " + className);
}
Also used : ServiceException(javax.xml.rpc.ServiceException) Remote(java.rmi.Remote)

Example 14 with ServiceException

use of javax.xml.rpc.ServiceException in project tdi-studio-se by Talend.

the class AddressDoctorClient method formatAndValidate.

/**
     * This is new API, let user to define a structured data "Address" to transmit to the server
     * 
     * @see: bug:6025
     * @param args
     * @throws Exception
     */
public static AddInteractiveResponse formatAndValidate(Long userId, String password, Address address, CountryOfOriginType originCountry, CountryType countryType, LineSeparatorType lineSeparator, CapitalizationType capitalize) throws Exception {
    try {
        // Parameter to set in component
        // String webServiceURI (should always be
        // http://validator2.addressdoctor.com/addInteractive/Interactive.asmx) -> no parameter for this
        InteractiveSoap interactiveSoap = (new com.AddressDoctor.validator2.addInteractive.Interactive.InteractiveLocator()).getInteractiveSoap();
        AddInteractiveRequest addInteractiveRequest = new AddInteractiveRequest();
        Parameters parameters = new Parameters();
        addInteractiveRequest.setAddress(address);
        // Advanced Parameter Settings
        parameters.setCountryOfOrigin(originCountry);
        parameters.setCountryType(countryType);
        parameters.setLineSeparator(lineSeparator);
        parameters.setCapitalization(capitalize);
        parameters.setPreferredLanguage(PreferredLanguageType.PFL_PRIMARY);
        addInteractiveRequest.setParameters(parameters);
        // web service call
        addInteractiveRequest.setAuthentication(new Authentication(userId, 0, password));
        AddInteractiveResponse resp = interactiveSoap.validate(addInteractiveRequest);
        return resp;
    } catch (ServiceException e) {
        throw e;
    } catch (RemoteException e) {
        throw e;
    }
}
Also used : InteractiveSoap(com.AddressDoctor.validator2.addInteractive.Interactive.InteractiveSoap) Parameters(com.AddressDoctor.validator2.addInteractive.Interactive.Parameters) ServiceException(javax.xml.rpc.ServiceException) Authentication(com.AddressDoctor.validator2.addInteractive.Interactive.Authentication) AddInteractiveResponse(com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveResponse) AddInteractiveRequest(com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveRequest) RemoteException(java.rmi.RemoteException)

Example 15 with ServiceException

use of javax.xml.rpc.ServiceException in project tdi-studio-se by Talend.

the class AddressDoctorClient method formatAndValidate.

/**
     * This is old API, via "DeliveryAddressLines" to transmit the input data to the server
     * 
     * @see: bug:6025
     * @param args
     * @throws Exception
     */
public static Result[] formatAndValidate(Long userId, String password, String addressLines, CountryOfOriginType originCountry, CountryType countryType, LineSeparatorType lineSeparator, CapitalizationType capitalize) throws Exception {
    try {
        // Parameter to set in component
        // String webServiceURI (should always be
        // http://validator2.addressdoctor.com/addInteractive/Interactive.asmx) -> no parameter for this
        InteractiveSoap interactiveSoap = (new com.AddressDoctor.validator2.addInteractive.Interactive.InteractiveLocator()).getInteractiveSoap();
        AddInteractiveRequest addInteractiveRequest = new AddInteractiveRequest();
        Parameters parameters = new Parameters();
        Address address = new Address();
        // set address with input row fixed schema
        address.setDeliveryAddressLines(addressLines);
        addInteractiveRequest.setAddress(address);
        // Advanced Parameter Settings
        parameters.setCountryOfOrigin(originCountry);
        parameters.setCountryType(countryType);
        parameters.setLineSeparator(lineSeparator);
        parameters.setCapitalization(capitalize);
        parameters.setPreferredLanguage(PreferredLanguageType.PFL_PRIMARY);
        addInteractiveRequest.setParameters(parameters);
        // web service call
        addInteractiveRequest.setAuthentication(new Authentication(userId, 0, password));
        AddInteractiveResponse resp = interactiveSoap.validate(addInteractiveRequest);
        Result[] results = resp.getResults();
        if (resp.getResultCount() > 0) {
            return results;
        } else {
            throw new Exception(resp.getErrorCode() + ":" + resp.getErrorMessage() + ":" + resp.getValidationStatus());
        }
    } catch (ServiceException e) {
        throw e;
    } catch (RemoteException e) {
        throw e;
    }
}
Also used : Parameters(com.AddressDoctor.validator2.addInteractive.Interactive.Parameters) Address(com.AddressDoctor.validator2.addInteractive.Interactive.Address) AddInteractiveRequest(com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveRequest) ServiceException(javax.xml.rpc.ServiceException) RemoteException(java.rmi.RemoteException) Result(com.AddressDoctor.validator2.addInteractive.Interactive.Result) InteractiveSoap(com.AddressDoctor.validator2.addInteractive.Interactive.InteractiveSoap) ServiceException(javax.xml.rpc.ServiceException) Authentication(com.AddressDoctor.validator2.addInteractive.Interactive.Authentication) AddInteractiveResponse(com.AddressDoctor.validator2.addInteractive.Interactive.AddInteractiveResponse) RemoteException(java.rmi.RemoteException)

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