use of org.apache.axis2.description.WSDL11ToAxisServiceBuilder in project carbon-business-process by wso2.
the class HumanTaskStore method validateServiceCreationForTaskConfig.
/**
* When wsdl errors are there in the package, we use a dummy service creation step to validate all required parts
* are available in the wsdl
* @param taskConfig Task configuration object for this task package
* @throws HumanTaskDeploymentException HumanTaskDeployment Exception is thrown when an error happens
*/
private void validateServiceCreationForTaskConfig(HumanTaskBaseConfiguration taskConfig) throws HumanTaskDeploymentException {
try {
WSDL11ToAxisServiceBuilder serviceBuilder = createAxisServiceBuilder(taskConfig, taskConfig.getWSDL());
serviceBuilder.populateService();
} catch (AxisFault e) {
String errorMsg = "Error validating wsdl " + e.getMessage();
throw new HumanTaskDeploymentException(errorMsg, e);
}
}
use of org.apache.axis2.description.WSDL11ToAxisServiceBuilder in project carbon-business-process by wso2.
the class HumanTaskStore method deploy.
private void deploy(HumanTaskBaseConfiguration taskConfig) throws HumanTaskDeploymentException {
if (taskConfig != null) {
/**
* Creating AxisService for HI
*/
if (log.isDebugEnabled()) {
log.debug("Deploying task " + taskConfig.getName());
}
AxisService axisService;
Definition wsdlDef = taskConfig.getWSDL();
if (taskConfig instanceof TaskConfiguration) {
// to get the task id as response
wsdlDef.getPortType(taskConfig.getPortType()).getOperation(taskConfig.getOperation(), null, null).setStyle(OperationType.REQUEST_RESPONSE);
} else {
// ONE_WAY no feed back for NOTIFICATIONS
wsdlDef.getPortType(taskConfig.getPortType()).getOperation(taskConfig.getOperation(), null, null).setStyle(OperationType.ONE_WAY);
}
WSDL11ToAxisServiceBuilder serviceBuilder = createAxisServiceBuilder(taskConfig, wsdlDef);
try {
axisService = createAxisService(serviceBuilder, taskConfig);
ServiceConfigurationUtil.configureService(axisService, taskConfig.getEndpointConfiguration(taskConfig.getServiceName().getLocalPart(), taskConfig.getPortName()), getConfigContext());
ArrayList<AxisService> serviceList = new ArrayList<AxisService>();
serviceList.add(axisService);
DeploymentEngine.addServiceGroup(createServiceGroupForService(axisService), serviceList, null, null, getTenantAxisConfig());
if (log.isDebugEnabled()) {
log.debug(" Published axis2 service " + axisService.getName() + " for task " + taskConfig.getName());
}
} catch (AxisFault axisFault) {
String errMsg = "Error populating the service";
log.error(errMsg);
throw new HumanTaskDeploymentException(errMsg, axisFault);
}
}
}
use of org.apache.axis2.description.WSDL11ToAxisServiceBuilder in project carbon-business-process by wso2.
the class AxisServiceUtils method populateAxisService.
private static AxisService populateAxisService(BPELProcessProxy processProxy, AxisConfiguration axisConfiguration, WSDL11ToAxisServiceBuilder serviceBuilder) throws AxisFault {
ProcessConf pConf = processProxy.getProcessConfiguration();
AxisService axisService = serviceBuilder.populateService();
axisService.setParent(axisConfiguration);
axisService.setWsdlFound(true);
axisService.setCustomWsdl(true);
axisService.setClassLoader(axisConfiguration.getServiceClassLoader());
URL wsdlUrl = null;
for (File file : pConf.getFiles()) {
if (file.getAbsolutePath().indexOf(processProxy.getWsdlDefinition().getDocumentBaseURI()) > 0) {
try {
wsdlUrl = file.toURI().toURL();
} catch (MalformedURLException e) {
String errorMessage = "Cannot convert File URI to URL.";
handleException(pConf.getProcessId(), errorMessage, e);
}
}
}
if (wsdlUrl != null) {
axisService.setFileName(wsdlUrl);
}
Utils.setEndpointsToAllUsedBindings(axisService);
axisService.addParameter(new Parameter("useOriginalwsdl", "true"));
axisService.addParameter(new Parameter("modifyUserWSDLPortAddress", "true"));
axisService.addParameter(new Parameter("setEndpointsToAllUsedBindings", "true"));
/* Setting service type to use in service management*/
axisService.addParameter(ServerConstants.SERVICE_TYPE, "bpel");
/* Process ID as a service parameter to use with process try-it*/
axisService.addParameter(BPELConstants.PROCESS_ID, pConf.getProcessId());
/* Fix for losing of security configuration when updating BPEL package*/
axisService.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true"));
return axisService;
}
Aggregations