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;
}
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);
}
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);
}
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;
}
}
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;
}
}
Aggregations